Skip to content
Prev 227170 / 398500 Next

transformation of data.frame

Hi

Assa Yeroslaviz <frymor at gmail.com> napsal dne 09.07.2010 13:25:43:
reading the
"character"))
paste(uu
I do not use doBy library so I cannot give you definite explanation. I do 
not believe that lapplyBy works with integers only. It says that it is a 
formula version of lapply.

This is what you did
gmt <- lapplyBy(~GO, data = go, FUN = function(uu) {as.list(uu$GO[1], 
paste(uu$gen, collapse = " "))})

and this is what S?ren advised
aa<-lapplyBy(~ID, data=ddd, FUN=function(uu){list(uu$ID[1], paste(uu$gen, 
collapse=":"))})

so maybe
gmt <- lapplyBy(~GO, data = go, FUN = function(uu) {list(uu$GO[1], 
paste(uu$gen, collapse = " "))})

Gives you desired result.

Regards
Petr
in
mailto:r-help-bounces at r-project.org
a
will