Bugzilla – Bug 15915
View() and nested data frames
Last modified: 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.