Displaying 1 result from an estimated 1 matches for "drop_var".
Did you mean:
drop_err
2012 Nov 24
5
subsetting - questions
...ror message for # 5 and # 7 ?
2) How to fix the code?
I would appreciate receiving your help.
Thanks,
Pradip Muhuri
###### Reproducible Example #####
N <- 100
set.seed(13)
df<-data.frame(matrix(sample(c(1:10),N, replace=TRUE),ncol=5))
keep_var <- c("X1", "X2")
drop_var <- c("X3", "X4", "X5")
df[df$X1>=8,] [,1:2] #1
df[df$X1>=8,] [,-c(3,4,5)] #2
df[df$X1>=8,] [,c(-3,-4,-5)] #3
df[df$X1>=8,] [,c("X1", "X2")] #4
df[df$X1>=8,] [,-c("X3", &qu...