Re: [R] Simple question regarding name of column headers

2010-07-16 Thread jim holtman
subset(miceTrainSample, select = -plD50) On Fri, Jul 16, 2010 at 11:22 AM, Addi Wei wrote: > > names(miceTrainSample) > [1] "b_double"  "KierA2"    "KierFlex"  "Q_VSA_POS" "pID50" > > In the above code, how do I delete "pID50" column to store the resulting > object without indicating column "5".

Re: [R] Simple question regarding name of column headers

2010-07-16 Thread Erik Iverson
Anyway, I have often wished that something like new.mt.sample <- miceTrainSample[, -"pID50"] would return miceTrainSample without the pID50 column. Here are three alternative ways to do it. # Method 1: Assign NULL to the column new.mt.sample <- miceTrainsSample new.mt.sample$pID50 <- NULL # Me

Re: [R] Simple question regarding name of column headers

2010-07-16 Thread Ista Zahn
Hi Addi, On Fri, Jul 16, 2010 at 3:22 PM, Addi Wei wrote: > > names(miceTrainSample) > [1] "b_double"  "KierA2"    "KierFlex"  "Q_VSA_POS" "pID50" > > In the above code, how do I delete "pID50" column to store the resulting > object without indicating column "5".  The code below does the trick, b

[R] Simple question regarding name of column headers

2010-07-16 Thread Addi Wei
names(miceTrainSample) [1] "b_double" "KierA2""KierFlex" "Q_VSA_POS" "pID50" In the above code, how do I delete "pID50" column to store the resulting object without indicating column "5". The code below does the trick, but I wish to delete the column by specifying "-pID50" instead of "5".