Created
February 19, 2018 07:33
-
-
Save cecilialee/2daf5056beb0e5753c1e47edeb9965dd to your computer and use it in GitHub Desktop.
Unnest nested dataframes in R. #r
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| unnest_dataframes <- function(x) { | |
| y <- do.call(data.frame, x) | |
| if ("data.frame" %in% sapply(y, class)) unnest_dataframes(y) | |
| y | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment