r - 如何在终端中打印 R 矩阵以适应宽屏

标签 r ubuntu printing terminal fullscreen

我在宽屏显示器的终端中使用 R。当我输入print(matrix(rnorm(10*10),ncol=10))时,它将打印 5 列,而我希望它在宽屏上打印所有 10 列。即使我将终端最大化,它也不会占用额外的宽屏空间来打印此矩阵。

我正在使用Ubuntu和底座R .

最佳答案

您可以使用此功能:

wideScreen <- function(howWide=Sys.getenv("COLUMNS")) {
  options(width=as.integer(howWide))
}

然后将值设置为wideScreen(1000)

来源:How to increase the number of columns using R in Linux

这是在启动时自动设置它的代码:

https://github.com/brendano/dlanalysis/blob/master/util.R

关于r - 如何在终端中打印 R 矩阵以适应宽屏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21375966/

相关文章:

r - 在 R 中使用 geom_smooth() 在 ggplot2 图例中混合填充颜色

r - R中大写和小写字符之间的字符串拆分?

python - 在 python 中,为什么使用日志而不是打印?

css - 从 chrome 浏览器打印错误地应用媒体查询中的移动类

r - 如何使用 dplyr 根据列 id 合并行数据

r - 循环遍历 data.table 中的列并转换这些列

ubuntu - Ubuntu for Windows 上的 phpunit 路径

c++ - Ubuntu 14.04 LTS x86-64bit Qt Creator 3.0.1 Kit Qt 4.8.6 程序启动失败。路径或权限错误?

python - 不小心安装了两个版本的 Python 3.4.1...无法运行任何脚本,无法导入任何模块,我该如何解决?

javascript - mozilla firefox 打开子窗口时缺少垂直滚动条