Skip to content

repr does not handle nested dataframes #71

@jankatins

Description

@jankatins
# 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"))

]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions