how to change number of columns and rows showing in R studio notebook dataframe

随声附和 提交于 2019-12-06 21:34:51

问题


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.


回答1:


For displaying more columns, is it something like this?

```{r set-options, echo=FALSE, cache=FALSE}
options(width = 120)
```


来源:https://stackoverflow.com/questions/45489697/how-to-change-number-of-columns-and-rows-showing-in-r-studio-notebook-dataframe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!