r - 覆盖 dplyr 中的 "Variables not shown",以显示来自 df 的所有列

标签 r dplyr options output-formatting displayformat

当我在本地数据框中有一列时,有时会收到消息 Variables not shown例如这个(荒谬的)例子只需要足够的列。

library(dplyr)
library(ggplot2) # for movies

movies %.% 
 group_by(year) %.% 
 summarise(Length = mean(length), Title = max(title), 
  Dramaz = sum(Drama), Actionz = sum(Action), 
  Action = sum(Action), Comedyz = sum(Comedy)) %.% 
 mutate(Year1 = year + 1)

   year    Length                       Title Dramaz Actionz Action Comedyz
1  1898  1.000000 Pack Train at Chilkoot Pass      1       0      0       2
2  1894  1.000000           Sioux Ghost Dance      0       0      0       0
3  1902  3.555556     Voyage dans la lune, Le      1       0      0       2
4  1893  1.000000            Blacksmith Scene      0       0      0       0
5  1912 24.382353            Unseen Enemy, An     22       0      0       4
6  1922 74.192308      Trapped by the Mormons     20       0      0      16
7  1895  1.000000                 Photographe      0       0      0       0
8  1909  9.266667              What Drink Did     14       0      0       7
9  1900  1.437500      Uncle Josh's Nightmare      2       0      0       5
10 1919 53.461538     When the Clouds Roll by     17       2      2      29
..  ...       ...                         ...    ...     ...    ...     ...
Variables not shown: Year1 (dbl)

我想看Year1 !我如何查看所有列,最好是默认情况下。

最佳答案

(现在)有一种方法可以覆盖打印出来的列的宽度。如果你运行这个命令一切都会好的

options(dplyr.width = Inf)

我写的 here .

关于r - 覆盖 dplyr 中的 "Variables not shown",以显示来自 df 的所有列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22471256/

相关文章:

javascript - 显示/隐藏基于关闭输入数字范围的选择 jQuery

r - 如何在R中根据其他变量创建新变量

r - 在 R 中,错误 "need at least one panel"是什么意思,如何解决?

r - 为什么digest函数与dplyr的mutate一起使用时每次都返回相同的值?

r - 库(dplyr): there is no package called ‘dplyr’ 中的错误

r - dplyr 通过在另一个数据帧上应用汇总函数来计算新列

sql - 使用 RODBC 的 MS-SQL 大容量插入

r - RStudio presentations/slidify/pandoc 中的两列布局

shell - *nix 命令行程序中长选项的单破折号与双破折号 - 最佳实践?

Javascript getElementById?