【问题标题】:Error in View() data.frame containing int64 in RStudioRStudio 中包含 int64 的 View() data.frame 中的错误
【发布时间】:2016-03-10 21:36:31
【问题描述】:

我在尝试使用 RStudio 中的 int64View() data.frames/.tables 时发现了一个问题(使用 v0.99.892,但问题与版本无关)。

> dt2
   a          b          c
1: 1 -126208802   84258755
2: 2 -126194884 1402875037
3: 3 -126199178         NA
4: 4 -126198991  778459540
5: 5 -126200004   42143878

> dput(dt2)
structure(list(a = 1:5, b = c(-126208802L, -126194884L, -126199178L, 
-126198991L, -126200004L), c = structure(c(4.16293562068544e-316, 
6.93112361189968e-315, 0, 3.8461011539138e-315, 2.08218423023247e-316
), class = "integer64")), .Names = c("a", "b", "c"), class = c("data.table", 
"data.frame"), row.names = c(NA, -5L), .internal.selfref = <pointer: 0x0000000000230788>)

> View(dt2)
Error in if (col_min < col_max) { : missing value where TRUE/FALSE needed

> View(as.data.frame(dt2)) # maybe it's data.table? -- nope
Error in if (col_min < col_max) { : missing value where TRUE/FALSE needed

> View(dt2[,1:2, with=FALSE]) # works if you drop the int64 column 

以下问题未解决这些特殊情况:Error in if/while (condition) {: missing Value where TRUE/FALSE needed

我目前的解决方法是删除 int64 列:

View2 <- function(dt){
  View(dt[, which(sapply(dt, class) != "integer64"), with=FALSE])
}

但是我经常使用大整数(通常作为键),能够仅查看()该死的东西会非常有帮助。有什么建议吗?

我在 Windows 7 x64 上运行 R 3.2.3。

【问题讨论】:

  • 我无法在 Windows 7 x64 上的 RStudio 0.99.465 R 3.2.3 中重现
  • @HubertL 感谢您的尝试 - 它是由fread() 生成的表格的子集...您认为发布原始 csv 的净化版本有什么价值吗,或者dput() 捕获一切
  • 来自 RStudio 的您好——我们认为这可能会在我们当前的预览版本中得到修复(我们最近对查看器中的大值进行了修复)。试试看? rstudio.com/products/rstudio/download/preview
  • @Jonathan 感谢您的评论 -- 我明天会试一试并在这里更新
  • @Jonathan 抱歉,我从来没有回复过你,但这个问题在 Windows RStudio 中的某个时间在 0.99.892(问题)和 1.0.153(我现在正在处理的问题)之间得到解决跨度>

标签: r rstudio int64


【解决方案1】:

正如@Jonathan 在 cmets 中提到的,RStudio 对查看器中的大值进行了修复。解决办法是update RStudio

【讨论】:

    猜你喜欢
    • 2013-10-27
    • 2015-12-23
    • 2010-10-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-14
    • 1970-01-01
    相关资源
    最近更新 更多