Ross Gayler Ross Gayler - 11 months ago 55
R Question

R View() does not display all columns of data frame

I have been adding columns to a data frame and using View() to check that it did what I expected. I have repeated lines of code along the lines of:

x$p <- 3 * x$a
x$q <- sqrt(x$b + x$c)

This worked fine until the number of columns exceeded 100 (there are 47,000 rows). When I added another two columns, dim(x) shows 102 columns, names(x) shows 102 names, summary(x) shows summaries of all the expected columns. However, View(x) only displays the first 100 columns and doesn't display the last two added columns.

If I try View(x[,-(1:10)]) the most recently added columns are displayed.

I can't see any mention in the View documentation of a limit on the number of columns. Can anyone explain what is happening here?


I also see this problem with x <- matrix(1:200,nrow=1); View(x) in RStudio, but not in vanilla R. It is a known limitation and they're working on it. You can contact the devs on their forum to give your feedback (and have done so, I see).