Bug 15915 - View() and nested data frames
View() and nested data frames
Status: NEW
Product: R
Classification: Unclassified
Component: Misc
R 3.1.0
All All
: P5 enhancement
Assigned To: R-core
Depends on:
  Show dependency treegraph
Reported: 2014-07-30 10:43 UTC by Jeroen
Modified: 2014-07-30 10:43 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Jeroen 2014-07-30 10:43:22 UTC
The utils::View function has difficulty showing nested data frames. For example:

  test <- data.frame(x=1:5)
  test$y <- data.frame(foo=rnorm(5), bar=rnorm(5))

Such nested data frames frequently appear when working with JSON data from the web. It would be great if the output of View() would be similar to print().

One easy fix would be to edit utils::View and replace

  x <- lapply(x0, as.num.or.char)


  x <- as.list(format.data.frame(x0))

The format.data.frame function is used by print.data.frame as well to prepare the data frame for display, including flattening any nested data frames.