How about:
xx[,-match("x2",names(xx))]
or
xx[,names(xx) != "x2"]
etc.
Bert Gunter
Genentech Nonclinical Biostatistics
650-467-7374
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Erin Hodgess
Sent: Tuesday, April 14, 2009 10:
On 4/15/2009 1:38 AM, Erin Hodgess wrote:
> Dear R People:
>
> Suppose I have the following data frame:
>
> x1 x2 x3
> 1 -0.1582116 0.06635783 1.765448
> 2 -1.1407422 0.47235664 0.615931
> 3 0.8702362 2.32301341 2.653805
>> str(xx)
> 'data.frame': 3 obs. of 3 variables
Great!
Thanks to both of you!
Sincerely,
Erin
On Wed, Apr 15, 2009 at 12:54 AM, Coen van Hasselt
wrote:
> Alternatively you could also drop the column like this:
>
> xx$x2<-NULL
>
>
> On Wed, Apr 15, 2009 at 15:51, Peter Alspach
> wrote:
>> Tena koe Erin
>>
>> xx[, names(xx)!='x2']
>>
>> HTH
Alternatively you could also drop the column like this:
xx$x2<-NULL
On Wed, Apr 15, 2009 at 15:51, Peter Alspach
wrote:
> Tena koe Erin
>
> xx[, names(xx)!='x2']
>
> HTH
>
> Peter Alspach
>
>> -Original Message-
>> From: r-help-boun...@r-project.org
>> [mailto:r-help-boun...@r-proj
Tena koe Erin
xx[, names(xx)!='x2']
HTH
Peter Alspach
> -Original Message-
> From: r-help-boun...@r-project.org
> [mailto:r-help-boun...@r-project.org] On Behalf Of Erin Hodgess
> Sent: Wednesday, 15 April 2009 5:39 p.m.
> To: R help
> Subject: [R] excluding a column from a data f
5 matches
Mail list logo