# https://blog.rstudio.org/2016/02/02/tidyr-0-4-0/
library(gapminder)
library(dplyr)
library(tidyr)
by_country <- gapminder %>%
group_by(continent, country) %>%
nest()
print(by_country) # prints ok
by_country # has the content of the data column messed up
One solution could be to add a if df contains a nested df/list/... column, refuse to rich print with a warning...
[I'm not sure if data.frames are allowed to contain nested data-frames, but I do have such a data.frame here coming from a JSON structure:
download.file("http://jsonstudio.com/wp-content/uploads/2014/02/world_bank.zip", "world_bank.zip")
world_bank <- jsonlite::stream_in(unz("world_bank.zip", "world_bank.json"))
]
One solution could be to add a
if df contains a nested df/list/... column, refuse to rich print with a warning...[I'm not sure if data.frames are allowed to contain nested data-frames, but I do have such a data.frame here coming from a JSON structure:
]