相关疑难解决方法(0)

在dplyr中覆盖"未显示的变量",以显示df中的所有列

当我在本地数据框中有一个列时,有时我得到的消息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 …
Run Code Online (Sandbox Code Playgroud)

r options output-formatting displayformat dplyr

34
推荐指数
3
解决办法
2万
查看次数

在 R-markdown 中显示 tibble 的所有行和列

我正在处理 R markdown 文件。分析结果以 的形式显示,tibble但为了看到所有的列和行,我需要点击展开。但是,由于我要将文件编织成 html,因此我需要显示 R markdown 文件中的所有列和行。我进行了搜索并得出了以下代码:

options(tibble.width = Inf) # displays all columns.
options(tibble.print_max = Inf) # to show all the rows.
Run Code Online (Sandbox Code Playgroud)

但是,我不知道把它们放在哪里。我把它们放在我的代码之前和之后,但没有用。我的代码是:

  1. head(df)
  2. summarise(mean_cov= ..., median_cov=...., sd_cov=...., ...)

谢谢。

r r-markdown

8
推荐指数
2
解决办法
2万
查看次数