Re: [R-sig-Geo] creating rasterStack from a matrix

2010-07-09 Thread Robert J. Hijmans
Steven, Not that I can think of. Something for the to-do list. Below is how you could make a RasterBrick (which should be preferable to a RasterStack for objects created in memory (and otherwise their behavior is similar to a RasterStack). globe<-brick(nrows=36, ncols=72) id <- data.frame(cell=1

Re: [R-sig-Geo] getValues() question

2010-07-09 Thread Robert J. Hijmans
Or perhaps: r <- mask(r, mask) v <- data.frame( rasterToPoints(r)[ , 3] ) # equivalent to # v <- data.frame( na.omit( getValues(r) ) ) Robert On Fri, Jul 9, 2010 at 2:00 PM, Jacob van Etten wrote: > You might try cellValues(). > Argument "cells" should be the indices of the non-masked cells. >

Re: [R-sig-Geo] Unable to read image because a memory limitation

2010-07-09 Thread Robert J. Hijmans
Francisco, You have not said why you want to read the image into memory, but chances are that you do not need to, if you use the 'raster' package to explore or manipulate your data. Robert On Fri, Jul 9, 2010 at 12:31 PM, Barry Rowlingson wrote: > On Fri, Jul 9, 2010 at 7:58 PM, Francisco Mauro

[R-sig-Geo] creating rasterStack from a matrix

2010-07-09 Thread steven mosher
Assuming I have a matrix of Nrows and Mcols where Column #1 is filled with a valid cell number for a raster. ALL cell numbers will not be present. Subsequent columns (2-M) contain the data that I want to place in a sequence of layers, so that in the end I have a rasterStack of M layers. M can

Re: [R-sig-Geo] getValues() question

2010-07-09 Thread Jacob van Etten
You might try cellValues(). Argument "cells" should be the indices of the non-masked cells. Something like this: cellInd <- which(getValues(r1) != mask.value) valueVector <- cellValues(r2, cells = cellInd) Jacob. --- On Fri, 9/7/10, Jonathan Greenberg wrote: From: Jonathan Greenberg Subje

Re: [R-sig-Geo] Unable to read image because a memory limitation

2010-07-09 Thread Barry Rowlingson
On Fri, Jul 9, 2010 at 7:58 PM, Francisco Mauro Gutiérrez wrote: > My problem is that R provides an Error message saying that it is not > possible to allocate a vector of 650 Mb. Does anyone now how can I increase > the memory limit? It looks like I should increase it to be able to read the > ima

[R-sig-Geo] Unable to read image because a memory limitation

2010-07-09 Thread Francisco Mauro Gutiérrez
Dear List, I’m trying to read a Landsat product in tif format with rgdal. The image size is : NDVIMULTITEMPMASK.tif has GDAL driver GTiff and has 5386 rows and 5507 columns and it has 5 bands. My problem is that R provides an Error message saying that it is not possible to a

[R-sig-Geo] getValues() question

2010-07-09 Thread Jonathan Greenberg
r-sig-geo'ers and Robert: If I want to pull out the values of a raster into a dataframe, ignoring "masked" values, what is the quickest way to do this? I can use getValues() and "post-process" the output, but is there a way to skip every loading these masked values into a memory in the first plac

[R-sig-Geo] primer on manipulating variables in spatial polygons data frames?

2010-07-09 Thread Ben Mazzotta
Do spatial polygon data frames have an equivalent of subscripting for data frames? Or perhaps a way to call variables akin to the get() command? I'd like to be able to write apply() functions over the variables in a spatial polygons data frame, so that I can automate the generation of plots.