Skip to content
Prev 374657 / 398513 Next

Convert a list of $NULL into multiple dataframes

There must be a simpler and easier way but it's early here and I am only on my first cup of tea.
Just but each element into a data frame.
Quick and dirty example:
============================dat1? <- list(aa = 1:20, bb? <- data.frame(xx = 1:5, yy = LETTERS[1:5]))

dat2 = data.frame(dat1[[1]])

======================================================
On Friday, May 18, 2018, 4:37:39 a.m. EDT, Ilio Fornasero <iliofornasero at hotmail.com> wrote:
I have the following list:
? ? $`NULL`
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? V1? ? V2? ? ? V3
? ? ? ? 1? ? ? ? ? ? ? ? ? Year? 1992? 1993


? ? $`NULL`
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? V1? ? ? ? ? ? ? ? ? ? ? ? ? V2? ? V3? ? V4
? ? ? ? ? 1? ? ? ? ? ? ? ? ? Age Average (cm)? ? N? ? ? SD
? ? ? ? ? 2? ? ? ? ? ? ? ? 18-19? ? ? ? ? ? ? ? ? ? ? ? 178.3? 6309 6.39

I want to turn it into 2 dataframes:

A
$V1
$V2
$V3


B
$V1
$V2
$V3


Any easy hint?
Thanks




??? [[alternative HTML version deleted]]

______________________________________________
R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.