Skip to content
Prev 4132 / 29559 Next

importing adf file to R using RArcInfo / converting adf file to R friendly format

Harry,

I have been able to reproduce your error and it seems that the problem
is that there is not enough memory to load your data. Furthermore, I am
not sure whether RArcInfo can handle this sort of gridded data. I
believe that your data is an Arc/Info Binary Grid, which can be read
with package rgdal:

library(rgdal)
dpath<-"/home/vrubio/tmp/GLiPHAmaps/global/poultry/totcor/glbpod1t0503m/hdr.adf"
x <- new("GDALReadOnlyDataset", dpath)
getDriver(x)
getDriverLongName(getDriver(x))

library(RColorBrewer)
xx<-asSGDF_GROD(x, output.dim=c(200, 200))
spplot(xx, "band1", 
   at=c(0, 10, 50, 100, 200, 500, 1000, 2500, max(xx$band1,
na.rm=TRUE)),
   col.regions=brewer.pal(8,"Oranges") )

If you require a higher resolution try to increase the values of
output.dim=c(200, 200) but be careful because it can take a lot of
memory.

Hope this helps,

Virgilio
On Tue, 2008-09-02 at 12:35 -0700, Harry Kim wrote: