如何更改R Studio笔记本数据框中显示的列和行数 [英] how to change number of columns and rows showing in R studio notebook dataframe

查看:467
本文介绍了如何更改R Studio笔记本数据框中显示的列和行数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我运行R Studio笔记本时,数据框/表默认为10行.如何显示20行?

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?

这与查看"功能不同,并且因为它是笔记本,所以数据框的可视化与R studio中的常规R可执行文件不同.我不是使用view函数,而是使用head(x,20)函数显示前20行,但是笔记本使我可以单击第2页选项卡以查看接下来的10行.

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.

推荐答案

要显示更多列,是这样吗?

For displaying more columns, is it something like this?

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

这篇关于如何更改R Studio笔记本数据框中显示的列和行数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆