Skip to content
Prev 31158 / 398506 Next

matrix subset question

Dear R-helpers,

If P is a matrix and I want to obtains one column from P I write:

x<-P[,k]

I always want to maintain the data as a matrix, even if the data is a
single row, to do that I have to write:

x<-P[,k,drop=FALSE]

Here is my question:
Is there any way that I can change my default to be drop=FALSE so that I do
not have to add this every single time?

Tomas,