Skip to content
Prev 284596 / 398502 Next

List to dataframe

Hi,
thank you...the sapply approach seems straight forward, although I don't get the names into an own column... When the list elements are named the name is used for the rownames. I'd like to have them as an own column and no row names...

like for the list:
list <- list(A=1:4, B=1:6, C=1:9)
t(sapply(list, function(x) c(length(x), sum(x > 5), sum(x < 5))))

/Johannes
--