Jochen,
You can have a look at   ?memory.size

It would probably save a lot of memory if you read the data from a text file
with read.table

>From your description I cannot really understand what you are attempting to
do. If all you want is a spatial index with cell numbers then it would
perhaps be easier to use raster :

 *install.packages("raster", repos="http://R-Forge.R-project.org";)*
library(raster)

#create a RasterLayer object according to your specifications
r <- raster(ncol=3600, nrow=1800)

# or
r <- raster()
res(r) <- 0.1

# this uses hardly any memory; and now you have functions available like:

cellFromXY(r, xy)  # where xy can be a  2 column matrix of x an y
yFromRow(r, 10)

In other words, this gives you access to the 6480000 million cell numbers
via efficient algorithms, without storing them all in memory.
Even though that should not be a problem:

r[] <- 1:ncell(r)
plot(r)

Robert


On Thu, Oct 8, 2009 at 8:37 AM, Jochen Albrecht <[email protected]>wrote:

> Fellow spatial statisticians:
> I am trying to align a bunch of world-wide datasets at 0.1 degree
> resolution. I figured that the easiest way to do that is to create a dataset
> where the rownames form the index that allows to relate all my
> variable-sized point datasets to. I therefore created a shapefile base
> dataset that contains appr. 6.5 million points and had hoped that I could
> read this into R to then link all my other data to. Unfortunately, I ran
> into memory allocation problems (see error messages attached to this email).
> My hunch is that these can be overcome by just changing some settings
> (hopefully without having to recompile R sources). Do you have suggestions
> what these are and what the practically hard limit is? 6.5 million points is
> large but not uncommon these days, so I figured that this should be doable
> without embarking on major efforts.
> Alternatively, would it save me a lot of memory space if I tried to read
> this into a SpatialPixel or SpatialGrid structure?
> Cheers,
>    Jochen
>
> > basepoints = readOGR(".", "basepoints")
> OGR data source with driver: ESRI Shapefile
> Source: ".", layer: "basepoints"
> with  3465355  rows and  7  columns
> Feature type: wkbPoint with 2 dimensions
> Warning in data.frame(dlist) :
>  Reached total allocation of 1535Mb: see help(memory.size)
> Warning in data.frame(dlist) :
>  Reached total allocation of 1535Mb: see help(memory.size)
> Warning in data.frame(dlist) :
>  Reached total allocation of 1535Mb: see help(memory.size)
> Warning in data.frame(dlist) :
>  Reached total allocation of 1535Mb: see help(memory.size)
> Warning in as.data.frame.integer(x[[i]], optional = TRUE) :
>  Reached total allocation of 1535Mb: see help(memory.size)
> Warning in as.data.frame.integer(x[[i]], optional = TRUE) :
>  Reached total allocation of 1535Mb: see help(memory.size)
> Warning in as.data.frame.integer(x[[i]], optional = TRUE) :
>  Reached total allocation of 1535Mb: see help(memory.size)
> Warning in as.data.frame.integer(x[[i]], optional = TRUE) :
>  Reached total allocation of 1535Mb: see help(memory.size)
> Error: cannot allocate vector of size 13.2 Mb
>
> _______________________________________________
> R-sig-Geo mailing list
> [email protected]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to