Re: [R] Combining logical operators to extract columns from a dataframe

2008-03-25 Thread Peter Dalgaard
[EMAIL PROTECTED] wrote: > Hi R-helpers, > > I have a dataframe (called data) with 100 columns, the columns of which are > named with integers ranging from 1900 to 1999. > > I wish to extract those columns which names are >=1950 and <=1970. > > I tried: > > data2<-subset(data,select=(names(data)>=1

Re: [R] Combining logical operators to extract columns from a dataframe

2008-03-25 Thread Erik Iverson
[EMAIL PROTECTED] wrote: > Hi R-helpers, > > I have a dataframe (called data) with 100 columns, the columns of which are > named with integers ranging from 1900 to 1999. > > I wish to extract those columns which names are >=1950 and <=1970. > > I tried: > > data2<-subset(data,select=(names(data

[R] Combining logical operators to extract columns from a dataframe

2008-03-25 Thread mtb954
Hi R-helpers, I have a dataframe (called data) with 100 columns, the columns of which are named with integers ranging from 1900 to 1999. I wish to extract those columns which names are >=1950 and <=1970. I tried: data2<-subset(data,select=(names(data)>=1950 & names(data)<=1970)) but that doesn