1

dplyr::as.tbl(mtcars) only fills 10 rows of the screen, as in screenshot below:

enter image description here

Can R be configured so that if a tbl_df can fill the whole R window without any data 'falling off the window' (as in the case of mtcars), then dplyr will force the tbl_df to fill the whole window.

So I want to the output of dplyr::as.tbl(mtcars) to be:

enter image description here

luciano
  • 13,158
  • 36
  • 90
  • 130
  • According to http://blog.rstudio.org/2015/01/09/dplyr-0-4-0/ `options(dplyr.print_max) is now 20, so dplyr will never print more than 20 rows of data (previously it was 100). The best way to see more rows of data is to use View().` – akrun Apr 01 '15 at 16:34
  • 1
    You may try `options(dplyr.print_max = 1e4)` – akrun Apr 01 '15 at 16:37
  • 1
    Also check http://stackoverflow.com/questions/23188900/view-entire-dataframe-when-wrapped-in-tbl-df – akrun Apr 01 '15 at 17:03

1 Answers1

9

Several ways to accomplish this:

# show up to 1000 rows and all columns *CAPITAL V in View*
df %>% View()

# set option to see all columns and fewer rows
options(dplyr.width = Inf, dplyr.print_min = 6)

# reset options to defaults (or just close R)
options(dplyr.width = NULL, dplyr.print_min = 10)

# for good measure, don't forget about glimpse()...
df %>% glimpse()
JasonAizkalns
  • 20,243
  • 8
  • 57
  • 116
  • I wonder…can anyone provide a function that will print the entire `tbl_df` object if the entire `tbl_df` object will fill the entire R window? – luciano Apr 01 '15 at 17:25