Dear list,

I got the following error:

backg <- randomPoints (envir, n=500)
Error in sample.int(length(x), size, replace, prob) :
  NA in probability vector


Nonetheless, trials with 50, 400 and 450 worked, the error appears only at
n>500

Any hint? Maybe ram issue?

I used the following rasterstack, which has worked nicely before.

> envir
class       : RasterStack
dimensions  : 1080, 2160, 2332800, 18  (nrow, ncol, ncell, nlayers)
resolution  : 0.1666667, 0.1666667  (x, y)
extent      : -180, 180, -90, 90  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs
names       :    bathy_30s, biogeo01_30s, biogeo02_30s, biogeo03_30s,
biogeo04_30s, biogeo05_30s, biogeo06_30s, biogeo07_30s, biogeo08_30s,
biogeo09_30s, biogeo10_30s, biogeo11_30s, biogeo12_30s, biogeo13_30s,
biogeo14_30s, ...
min values  : -10138.11719,   -100.00000,   -100.00000,   -188.89999,
-803.25000,      1.00000,      0.00000,   -155.00000,      9.55414,
 -2394.11328,    382.62500,      2.02000,      0.00000,   -200.00000,
-200.00000, ...
max values  :      -1.0000,     100.0000,     100.0000,     196.0000,
155.6667,    2773.4924,     392.5000,     928.2500,    4040.3918,
 4012.0000,    4194.1431,    4002.3899, 1827274.1250,    3033.5308,
 2905.3169, ...


> sessionInfo()
R version 3.0.1 (2013-05-16)
Platform: i386-w64-mingw32/i386 (32-bit)

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United
States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C

[5] LC_TIME=English_United States.1252

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

other attached packages:
 [1] ncdf_1.6.6         foreign_0.8-53     maptools_0.8-27
 geosphere_1.3-8
 [5] rgdal_0.8-14       rJava_0.9-6        outliers_0.14      XML_3.98-1.1

 [9] PBSmapping_2.66.53 rgeos_0.3-2        reshape_0.8.4      plyr_1.8

[13] dismo_0.9-1        raster_2.1-66      sp_1.0-14

loaded via a namespace (and not attached):
[1] grid_3.0.1      lattice_0.20-15 tools_3.0.1

-- 
Agustín Camacho Guerrero.
Doutor em Zoologia.
Laboratório de Herpetologia, Departamento de Zoologia, Instituto de
Biociências, USP.
Rua do Matão, trav. 14, nº 321, Cidade Universitária,
São Paulo - SP, CEP: 05508-090, Brasil.

	[[alternative HTML version deleted]]

