[R] Error in vector("double", length)

Kumudan cybermails at gmail.com
Fri Jul 25 23:18:21 CEST 2008


Please see the code below.
When I try to run the variogram - vg.deft<-variog(rd,uvec=10)
I keep getting this error-
variog: computing omnidirectional variogram
Error in vector("double", length) : vector size specified is too large

Also, when I try to define distance-based neighborhood -
nb.tr=dist.neighbors(tr.locs,2)
I get this error -
Error in vector("double", length) : vector size cannot be NA
In addition: Warning message:
NAs produced by integer overflow in: n * n
-----------------------------------------------------------------------
#Code:

library(geoR)#for variograms and kriging
library(akima)#for interp
library(fields)#for plot.surface
library(spatstat)
library(spdep)

#transform coordinates in kilometers, and redefine origin
newx=(xcoord-min(xcoord))/1000
newy=(ycoord-min(ycoord))/1000
plot(newx,newy,pch=20,xlab="X coordinate (km)",ylab="Y coordinate (km)")

#set of new locations to be used from here on
tr.locs=cbind(newx,newy)

#transform proportions using an angular transformation
rel.tr=asin(sqrt(rel_dom/100))

#set as geodata
rd<-as.geodata(cbind(tr.locs, rel.tr))

#calculate empirical variogram
vg.deft<-variog(rd,uvec=10)

#define distance-based neighborhood based on function written in separate code
nb.tr=dist.neighbors(tr.locs,2)
-----------------------------------------------------------------

My data has over 78,000 rows of data. I'm using R 2.2.1 on Windows XP
professional, 2 GB RAM, Core2Duo 2.13 GHz
Can someone please help me find a solution to my problem? Please let
me know if you need any other information.

Thanks,
Kumudan



More information about the R-help mailing list