显示/打印小标题的所有行(tbl_df) [英] Display / print all rows of a tibble (tbl_df)
问题描述
tibble
(以前为tbl_df
)是由R中的dplyr
数据帧操作包创建的数据帧的版本.它可以防止在意外调用数据帧时出现长表输出.
tibble
(previously tbl_df
) is a version of a data frame created by the dplyr
data frame manipulation package in R. It prevents long table outputs when accidentally calling the data frame.
一旦数据帧被tibble
/tbl_df
包装,是否有命令查看整个数据帧(数据帧的所有行和列)?
Once a data frame has been wrapped by tibble
/tbl_df
, is there a command to view the whole data frame though (all the rows and columns of the data frame)?
如果使用df[1:100,]
,我将看到所有100行,但是如果使用df[1:101,]
,它将仅显示前10行.我想轻松显示所有行以快速滚动它们.
If I use df[1:100,]
, I will see all 100 rows, but if I use df[1:101,]
, it will only display the first 10 rows. I would like to easily display all the rows to quickly scroll through them.
是否有dplyr命令来抵消此问题或解包数据帧的方法?
Is there either a dplyr command to counteract this or a way to unwrap the data frame?
推荐答案
您也可以使用
print(tbl_df(df), n=40)
或在管道操作员的帮助下
or with the help of the pipe operator
df %>% tbl_df %>% print(n=40)
要打印所有行,请指定tbl_df %>% print(n = Inf)
To print all rows specify tbl_df %>% print(n = Inf)
这篇关于显示/打印小标题的所有行(tbl_df)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!