小智 202
你也可以用
print(tbl_df(df), n=40)
Run Code Online (Sandbox Code Playgroud)
或在管道操作员的帮助下
df %>% tbl_df %>% print(n=40)
Run Code Online (Sandbox Code Playgroud)
要打印所有行指定 tbl_df %>% print(n = Inf)
Vin*_*ynd 82
你可以使用as.data.frame或print.data.frame.
如果您希望这是默认值,则可以更改dplyr.print_max选项的值.
options(dplyr.print_max = 1e9)
Run Code Online (Sandbox Code Playgroud)
BLT*_*BLT 53
该tibble小品有一个更新的方式更改其默认的打印行为:
您可以使用选项控制默认外观:
options(tibble.print_max = n, tibble.print_min = m):如果有多于n行,则只打印前m行.使用options(tibble.print_max = Inf)始终显示所有行.
options(tibble.width = Inf)无论屏幕的宽度如何,都将始终打印所有列.
例子
这将始终打印所有行:
options(tibble.print_max = Inf)
Run Code Online (Sandbox Code Playgroud)
这实际上不会将打印限制为50行:
options(tibble.print_max = 50)
Run Code Online (Sandbox Code Playgroud)
但这会将打印限制为50行:
options(tibble.print_max = 50, tibble.print_min = 50)
Run Code Online (Sandbox Code Playgroud)
正如bookdown 文档中详述的那样,您还可以使用分页表
mtcars %>% tbl_df %>% rmarkdown::paged_table()
Run Code Online (Sandbox Code Playgroud)
这将对数据进行分页并允许浏览所有行和列(除非配置为限制行)。例子: