[R] Selecting A List of Columns

2013-05-17 Thread Sparks, John James
Dear R Helpers, I need help with a slightly unusual situation in which I am trying to select some columns from a data frame. I know how to use the subset statement with column names as in: x=as.data.frame(matrix(c(1,2,3, 1,2,3, 1,2,2, 1,2,2,

Re: [R] Selecting A List of Columns

2013-05-17 Thread Pascal Oettli
Hello, It works for me if I replace ImportantVars - as.character(ImportantVars) by ImportantVars - ImportantVars$Vars Hope this helps, Pascal 2013/5/17 Sparks, John James jspa...@uic.edu Dear R Helpers, I need help with a slightly unusual situation in which I am trying to select

Re: [R] Selecting A List of Columns

2013-05-17 Thread peter dalgaard
On May 17, 2013, at 12:02 , peter dalgaard wrote: On May 17, 2013, at 08:51 , Sparks, John James wrote: Dear R Helpers, I need help with a slightly unusual situation in which I am trying to select some columns from a data frame. I know how to use the subset statement with column

Re: [R] Selecting A List of Columns

2013-05-17 Thread peter dalgaard
On May 17, 2013, at 08:51 , Sparks, John James wrote: Dear R Helpers, I need help with a slightly unusual situation in which I am trying to select some columns from a data frame. I know how to use the subset statement with column names as in: Notice that subset() is a convenience