Re: [R] removing loops from code in making data.frame

2013-01-16 Thread arun
A.K. From: Biau David To: arun Cc: R help Sent: Wednesday, January 16, 2013 7:37 AM Subject: Re: [R] removing loops from code in making data.frame thanks, it goes a lot faster. Just one thing though, when I apply the code to my data, both data.frames end up "differente. Or at least

Re: [R] removing loops from code in making data.frame

2013-01-16 Thread Biau David
ing of the sort? thanks,   David Biau > > De : arun >À : Biau David >Cc : R help >Envoyé le : Mardi 15 janvier 2013 21h54 >Objet : Re: [R] removing loops from code in making data.frame > >Hi, > >You could also do this: &

Re: [R] removing loops from code in making data.frame

2013-01-15 Thread arun
Hi, You could also do this: res1<-do.call(rbind,lapply(xaulist,function(x) as.numeric(apply(t(mapply(`==`,tata,x)),2,any identical(res1,tutu) #[1] TRUE A.K. - Original Message - From: Biau David To: r help list Cc: Sent: Tuesday, January 15, 2013 2:41 PM Subject: [R] removing

Re: [R] removing loops from code in making data.frame

2013-01-15 Thread arun
Hi, May be this helps: res<-do.call(rbind,lapply(xaulist,function(x) as.integer(apply(tata,1,function(i) any(i==x) res[]<-sapply(res,as.numeric) identical(res,tutu) #[1] TRUE A.K. - Original Message - From: Biau David To: r help list Cc: Sent: Tuesday, January 15, 2013 2:41 PM