12

When I run my R studio notebook, the dataframe/tables are defaulted to 10 rows. How can I display 20 rows?

As well, if I have many columns, I have to click the "next" button on the top right to see the other columns. How can I display all the columns at the same time? The browser definitely has enough space to view a bigger table, but could this be another possible solution to view all the columns together: shrink the font in each column? If so, how can I do this?

This is different from the "View" function, and because it's a notebook, the visualization of the dataframe is different from a regular R executable in R studio. Instead of the view function, I'm using the head(x,20) function to display the first 20 rows, but the notebook makes me hit the page 2 tab to see the next 10 rows.

user1569897
  • 437
  • 1
  • 5
  • 12
  • 6
    For those interested, I've found some commands that do something similar: specifying `rows.print=20` allowed me to show 20 rows but `cols.print=10` did not display all the columns, the columns still get paged, despite having ample space in the browser window. I'm not sure whether `paged.print` is able to display all the columns, but a side effect is that it removes all formatting in the tables and makes the aesthetics really poor, so I'm not interested in using it. – user1569897 Aug 03 '17 at 19:20
  • Did you figure this out? I've been looking for this for a while. – Khashir May 27 '18 at 21:05
  • `cols.print = 18` worked for me ! – Lazarus Thurston May 14 '22 at 18:11

2 Answers2

2

For displaying more columns, is it something like this?

```{r set-options, echo=FALSE, cache=FALSE}
options(width = 120)
```
Bing
  • 1,083
  • 1
  • 10
  • 20
-2
options(repr.matrix.max.cols=50, repr.matrix.max.rows=100)
Layray
  • 105
  • 1
  • 2
  • 9