Skip to content
Prev 30628 / 398506 Next

making a dataframe out of lapply() result

one=c(1,1,2,2,3,3), two=c(6,6,7,7,8,8))
 > tester.L <- split(tester, tester$groups)
 > as.data.frame(lapply(tester.L, function(x) x <- unlist(x[1,] )))
        A B C
groups 1 2 3
one    1 2 3
two    6 7 8

How's this?
Spencer Graves
Remko Duursma wrote: