[R-br] table with >= 2^31 elements

Roney Fraga Souza roneyfraga em gmail.com
Segunda Abril 7 19:13:08 BRT 2014


Pessoal, 

Utilizando o pacote survey resolvi estratificar a amostra de uma base de dados de com as seguintes dimensões:

> dim(mydata)
[1] 20274412        4

com o seguinte comando:

monom00.svy <- svydesign(id=~V0300, strata=~AREAP, weights=~P001p, data=mydata) 

obtive a seguinte mensagem de erro:
Error in table(ids[, 1], strata[, 1]) : 
  attempt to make a table with >= 2^31 elements

Com o comando traceback() tenho:
6: stop("attempt to make a table with >= 2^31 elements")
5: table(ids[, 1], strata[, 1])
4: is.data.frame(x)
3: rowSums(table(ids[, 1], strata[, 1]) > 0)
2: svydesign.default(id = ~V0300, strata = ~AREAP, weights = ~P001p, 
       data = mydata)
1: svydesign(id = ~V0300, strata = ~AREAP, weights = ~P001p, data = mydata)

Alguém tem alguma sugestão de como lidar com isso?

Informações úteis:
> .Machine$integer.max
[1] 2147483647

> sessionInfo()
R version 3.1.0 beta (2014-03-28 r65330)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=pt_BR.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=pt_BR.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=pt_BR.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=pt_BR.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
 [1] splines   grid      tools     stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] plotrix_3.5-5         ggplot2_0.9.3.1       doBy_4.5-10           MASS_7.3-31           pastecs_1.3-18       
 [6] boot_1.3-11           psych_1.4.3           weights_0.80          gdata_2.13.3          Hmisc_3.14-3         
[11] Formula_1.1-1         survival_2.37-7       lattice_0.20-27       survey_3.29-5         reshape_0.8.4        
[16] plyr_1.8.1            quantreg_5.05         SparseM_1.03          ETLUtils_1.2          ffbase_0.11.3        
[21] ff_2.2-12             bit_1.1-11            sqldf_0.4-7.1         RSQLite.extfuns_0.0.1 RSQLite_0.11.4       
[26] DBI_0.2-7             gsubfn_0.6-5          proto_0.3-10          vimcom.plus_0.9-93    setwidth_1.0-3       
[31] colorout_1.0-2       

loaded via a namespace (and not attached):
 [1] chron_2.3-45        cluster_1.15.2      colorspace_1.2-4    dichromat_2.0-0     digest_0.6.4       
 [6] fastmatch_1.0-4     gtable_0.1.2        gtools_3.3.1        labeling_0.2        latticeExtra_0.6-26
[11] lme4_1.1-5          Matrix_1.1-3        minqa_1.2.3         munsell_0.4.2       nlme_3.1-117       
[16] RColorBrewer_1.0-5  Rcpp_0.11.1         RcppEigen_0.3.2.1.1 reshape2_1.2.2      scales_0.2.3       
[21] stringr_0.6.2       tcltk_3.1.0        


Atenciosamente
Roney


Mais detalhes sobre a lista de discussão R-br