Hi Arun:
Exactly. That's exactly what I'm looking for!
On 2012-11-12, at 5:55 PM, arun kirshna [via R] wrote:
> Hi,
> Seems like there was a typo in "mylist"
> mylist<-list(df1=data.frame(a=seq(1,10,1), c=seq(1,10,1), q10=rep('favour',
> 10)), df2=data.frame(a=seq(1,10,1), b=seq(15,24,1), q14=r
Hi,
In addition to:
mylist<-list(df1=data.frame(a=seq(1,10,1), c=seq(1,10,1), q10=rep('favour',
10)), df2=data.frame(a=seq(1,10,1), b=seq(15,24,1), q14=rep('favour', 10)))
lapply(mylist,function(x) x[colnames(x)%in% c("a","q10","q14")])
you could also use: lapply(seq_along(mylist),function(i)
m
Hello,
Try the following.
lapply(mylist, function(x) x[,grep("a|q", names(x))])
Hope this helps,
Rui Barradas
Em 12-11-2012 22:34, Simon Kiss escreveu:
Hi:
How do I select different variables from a list of data frames.
I have a list of 13 that looks like below. Each data frame has more vari
3 matches
Mail list logo