Re: [R] Subsetting dataframes based on column names

2009-09-22 Thread Henrique Dallazuanna
You can use intersect also: dat.a[intersect(names(dat.a), names(dat.b))] On Tue, Sep 22, 2009 at 6:58 PM, Corey Sparks wrote: > Dear R users, > I am interested in taking the columns from multiple dataframes, the problem > is that the different dataframes have different combinations of the same

Re: [R] Subsetting dataframes based on column names

2009-09-22 Thread David Winsemius
On Sep 22, 2009, at 5:58 PM, Corey Sparks wrote: Dear R users, I am interested in taking the columns from multiple dataframes, the problem is that the different dataframes have different combinations of the same variable names, here's a simple example: a<-rep(1:10) b<-rep(1:10) c<-rep(21:3