[R] runif error - maximum limit?
dprosser at usgs.gov
Wed Mar 21 20:41:06 CET 2012
I am receiving the error below, I think because my n is exceeding the
allowable limit for a vector.
Can anyone confirm, and help with the following questions?
The function and error:
> stPte8 <- rtrunc(rnorm, nx * ny * nsimu, linf=0, mean=as.vector(PTmn),
Error in runif(n, min = pinf, max = psup) : invalid arguments
My total n is calculated by:
nx=4053, ny=4848, nsimu=1000,
n = nx*ny*nsimu = 19,648,994,000
I believe the maximum size of a vector is 2^31-1 (2,147,483,647) - clearly
smaller than my n.
I have done some initial reading about how to deal with large datasets in R,
with reference to bigmemory and ff. For anyone who has experience in this,
would you have advice regarding using these packages as opposed to creating
a work-around such as reducing the size of the matrix (the ny by nx),
batching the simulations, then piecing them back together outside of R
Thanks for any insights you might have.
R version 2.14.2 (2012-02-29)
Platform: x86_64-pc-mingw32/x64 (64-bit) -- 88GB RAM
attached base packages:
 stats graphics grDevices utils datasets methods base
other attached packages:
 MASS_7.3-17 rgdal_0.7-8 raster_1.9-70 sp_0.9-97
loaded via a namespace (and not attached):
 grid_2.14.2 lattice_0.20-0
View this message in context: http://r.789695.n4.nabble.com/runif-error-maximum-limit-tp4493486p4493486.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help