R: Rotate list data into Dataframe
I have list data generated from JSON file generated by ODK Aggregate. It looks something like this:
P1 <- list(a01 = 1:11, a02 = letters[1:11], a03 = list(letters), a04 = (1:11)^2)
What I would like to do is basically convert P1 to dataframe by dropping all nested lists ( a03
). With this simple example, we get the following as our final result.
P1data <- data.frame(a01 = 1:11, a02 = letters[1:11], a04 = (1:11)^2)
Thanks for any help you can provide!
+3
source to share