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".
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
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
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".
4 matches
Mail list logo