2015-05-04 1 views
5

Ho trovato il pacchetto tabplot per la visualizzazione di un grande database. Ho eseguito utilizzando il codice qui sotto, ma ottengo questo errore su diversi frame di dati:Qual è il significato di questo errore "Errore in if (qualsiasi (B <1)) stop (" B too small ")" durante l'utilizzo del pacchetto 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" 

Ecco un esempio:

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 

alcuna idea di come superare questo problema?

UPDATE - ho usato un altro computer e funziona computer fine.Both sono su Windows a 64 bit, ma sul computer che ho preso a lavorare il sistema operativo è Win7 Pro e sul computer che ha l'errore del sistema operativo è WIN SERVER 2013

+0

Ho solo ricevuto un avviso (v 1.1.). Quale versione del pacchetto stai usando? –

+0

La versione è 1.1 – mql4beginner

+0

A questo punto, penso che avremo bisogno di un esempio riproducibile. Qualcuno può riconfermare l'errore? –

risposta

2

Secondo un commento di schuemie, questo errore ha a che fare con la quantità di memoria necessaria per ffdfdlpy, e può essere fissato con una corsa per ogni sessione di

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

permetterà che questo lavoro .

posso confermare che questo funziona con 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

1

Il problema si trova nel comando bbatch(n, as.integer(BATCHBYTES/theobytes)). Qualunque cosa tu stia facendo sta causando l'introduzione di NA s quando sono previsti numeri interi. E any(NA < 1)NA. Questo ha l'effetto che il comando if() non può decidere se il valore è TRUE o FALSE:

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

mia ipotesi (ed è un'ipotesi assoluta in questa fase senza ulteriori prove) è quello di provare ad aggiungere stringsAsFactors=FALSE al vostro read.table() comando.

+0

Aggiunta di stringheAsFactors = FALSE non ha aiutato ... Tutte le variabili sono di tipo int. – mql4beginner

+0

@ mql4beginner 'In bbatch (n, as.integer (BATCHBYTES/theobytes)): le NA introdotte per coercizione' mi dicono che qualcosa, da qualche parte, non è di tipo "intero" o "numerico". Suggerisco di guardare cosa sono esattamente 'BATCHBYTES' e' theobytes'. –

+0

Ho letto che BATCHBYTES e theobytes sono legati al pacchetto 'ffdfdply' usato dal pacchetto 'tabplot' ma non vedo come posso cambiarli – mql4beginner