Skip to content

Instantly share code, notes, and snippets.

@cecilialee
Created February 19, 2018 07:33
Show Gist options
  • Select an option

  • Save cecilialee/2daf5056beb0e5753c1e47edeb9965dd to your computer and use it in GitHub Desktop.

Select an option

Save cecilialee/2daf5056beb0e5753c1e47edeb9965dd to your computer and use it in GitHub Desktop.
Unnest nested dataframes in R. #r
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