I've noticed a problem when attempting to View()
data.frames/.tables with int64
columns in RStudio (using v0.99.892, but problem is not version specific).
> 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
The following question does not address these particular circumstances: Error in if/while (condition) {: missing Value where TRUE/FALSE needed
My current workaround is just to drop the int64 columns:
View2 <- function(dt){
View(dt[, which(sapply(dt, class) != "integer64"), with=FALSE])
}
But I work with big integers a lot (typically as keys) and it would be super helpful to be able to just View() the darn things. Any advice?
I'm running R 3.2.3 on Windows 7 x64.
As @Jonathan mentioned in comments, RStudio made a fix for large values in the viewer. The solution is to update RStudio.