Skip to content
Back to formatted view

Raw Message

Message-ID: <OF6E561127.2B33AF51-ON85256D12.0059F861@mail.gm.com>
Date: 2003-04-24T16:42:21Z
From: tomas.larsson@gm.com
Subject: 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,