6

我找到了用于可视化大型数据库的 tabplot 包。我使用下面的代码运行它,但在不同的数据帧上出现此错误:

"Error in if (any(B < 1)) stop("B too small") : 
  missing value where TRUE/FALSE needed
In addition: Warning message:
In bbatch(n, as.integer(BATCHBYTES/theobytes)) : NAs introduced by coercion"

这是一个例子:

dat <- read.table(text = " birds    wolfs     snakes
                     3        9         7
                     3        8         4
                     1        2         8
                     1        2         3
                     1        8         3
                     6        1         2
                     6        7         1
                     6        1         5
                     5        9         7
                     3        8         7
                     4        2         7
                     1        2         3
                     7        6         3
                     6        1         1
                     6        3         9
                     6        1         1   ",header = TRUE)
install.packages("tabplot")
package ‘ff’ successfully unpacked and MD5 sums checked
package ‘bit’ successfully unpacked and MD5 sums checked
package ‘fastmatch’ successfully unpacked and MD5 sums checked
package ‘ffbase’ successfully unpacked and MD5 sums checked
package ‘tabplot’ successfully unpacked and MD5 sums checked
library("tabplot", lib.loc="~/R/win-library/3.1")
 tab <- tableplot(dat, plot = FALSE) ## The tabplot  command
Error in if (any(B < 1)) stop("B too small") : 
  missing value where TRUE/FALSE needed
In addition: Warning message:
In bbatch(n, as.integer(BATCHBYTES/theobytes)) : NAs introduced by coercion

任何想法如何克服这个问题?

更新- 我使用了另一台计算机,它工作正常。两台计算机都在 Windows 64 位上,但在我让它工作的计算机上,操作系统是 Win7 pro,而在出现错误的计算机上,操作系统是 WIN SERVER 2013

4

2 回答 2

2

根据schuemie的评论,此错误与 所需的内存量有关ffdfdlpy,并且可以通过每次会话运行来修复

options(ffmaxbytes = min(getOption("ffmaxbytes"),.Machine$integer.max * 12))

将允许这个工作。

我可以确认这适用于sessionInfo()

R version 3.2.4 (2016-03-10) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 7 x64 (build 7601) Service Pack 1

于 2016-03-16T15:25:37.613 回答
1

问题出在命令bbatch(n, as.integer(BATCHBYTES/theobytes))上。无论您在做什么NA,都会在需要整数时引入 s 。并any(NA < 1)给出NA. 这会导致if()命令无法确定您的值是TRUE还是FALSE

if ( NA ) stop("This is silly")
#  Error in if (NA) stop("This is silly") : 
#    missing value where TRUE/FALSE needed

我的猜测(这是现阶段的完全猜测,无需进一步测试)是尝试添加stringsAsFactors=FALSE到您的read.table()命令中。

于 2015-05-04T10:08:21.873 回答