在 R-markdown 中显示 tibble 的所有行和列 [英] displaying all the rows and columns of tibble in R-markdown

查看:230
本文介绍了在 R-markdown 中显示 tibble 的所有行和列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm working on an R markdown file. The results of analysis are shown in the form of tibble but in order to see all the columns and rows, I need to click to expand. However, since I'm going to knit the file into html, I need to display all the columns and rows in the R markdown file. I did a search and came up with the following codes:

options(tibble.width = Inf) # displays all columns.
options(tibble.print_max = Inf) # to show all the rows.

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

However, I don't know where to put them. I placed them before and after my code, but it didn't work. MY codes are:

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

谢谢.

推荐答案

a tibble 是一种特定类型的 data.frame(尝试 class(df)),并且它有自己的打印方法,当你想要完整的东西时会很沮丧.

a tibble is a specific type of data.frame (try class(df)), and it has its own method to print, which is frustrating when you want the full thing.

因为它仍然是一个 data.frame 虽然你可以使用 data.frames 的方法并且它会打印所有内容,请尝试:

As it's still a data.frame though you can use the method for data.frames and it will print everything, try:

print.data.frame(df)

print.data.frame(head(df))

print.data.frame(summarize...)

注意 as.data.frame 将有相同的输出

Note that as.data.frame will have the same output

这篇关于在 R-markdown 中显示 tibble 的所有行和列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆