R View() 不显示数据框的所有列 [英] R View() does not display all columns of data frame

查看:50
本文介绍了R View() 不显示数据框的所有列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在向数据框中添加列并使用 View() 检查它是否符合我的预期.我有重复的代码行:

I have been adding columns to a data frame and using View() to check that it did what I expected. I have repeated lines of code along the lines of:

x$p <- 3 * x$a
x$q <- sqrt(x$b + x$c)
View(x)

这一直很好,直到列数超过 100(有 47,000 行).当我添加另外两列时,dim(x) 显示 102 列,names(x) 显示 102 个名称,summary(x) 显示摘要所有预期的列.但是,View(x) 只显示前 100 列,不显示添加的最后两列.

This worked fine until the number of columns exceeded 100 (there are 47,000 rows). When I added another two columns, dim(x) shows 102 columns, names(x) shows 102 names, summary(x) shows summaries of all the expected columns. However, View(x) only displays the first 100 columns and doesn't display the last two added columns.

如果我尝试 View(x[,-(1:10)]) 将显示最近添加的列.

If I try View(x[,-(1:10)]) the most recently added columns are displayed.

我在查看文档中没有看到任何关于列数限制的提及.谁能解释一下这里发生了什么?

I can't see any mention in the View documentation of a limit on the number of columns. Can anyone explain what is happening here?

推荐答案

我也看到这个问题 x <- matrix(1:200,nrow=1);View(x) 在 RStudio 中,但不是在 vanilla R 中.这是一个已知的限制和 他们正在努力.您可以在他们的论坛上联系开发人员以提供您的反馈(我知道已经这样做了).

I also see this problem with x <- matrix(1:200,nrow=1); View(x) in RStudio, but not in vanilla R. It is a known limitation and they're working on it. You can contact the devs on their forum to give your feedback (and have done so, I see).

这篇关于R View() 不显示数据框的所有列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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