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 fun

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

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 > Dear R Helpers, > > I need help with a slightly unusual situation in which I am trying to > select some colum

[R] Selecting A List of Columns

2013-05-16 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, 1,1,1),ncol=3,byrow=T