try this:
l <- vector("list", 3)
l[[1]] <- list(4, "hello")
l[[2]] <- list(7, "world")
l[[3]] <- list(9, " ")
lis <- lapply(l, "names<-", value = c("V1", "V2"))
do.call("rbind", lapply(lis, data.frame, stringsAsFactors = FALSE))
I hope it helps.
Best,
Dimitris
Dimitris Rizopoulos
Bio
Perhaps
data.frame(do.call(rbind, l))
?
- Erik Iverson
[EMAIL PROTECTED] wrote:
> Hello,
>
>
> Given a list with all elements having identical layout, e.g.:
>
>
> l = NULL
> l[[1]] = list(4, "hello")
> l[[2]] = list(7, "world")
> l[[3]] = list(9, " ")
>
>
> is there an easy way to co
Hello,
Given a list with all elements having identical layout, e.g.:
l = NULL
l[[1]] = list(4, "hello")
l[[2]] = list(7, "world")
l[[3]] = list(9, " ")
is there an easy way to collapse this list into a data.frame with each
row being the elements of the list ?
I.e. in this case I want to
3 matches
Mail list logo