Re: [R-sig-Geo] gridded time series analysis

2010-11-26 Thread Jacob van Etten
you could try this approach (use calc whenever you can): (supposing your bricks have 12 layers) br3 - stack(brick1, brick2) lmS - function(x) lm(x[1:12] ~ x[13:24)$coefficients[2] r - calc(br3, lmS) Jacob. --- On Fri, 26/11/10, steven mosher mosherste...@gmail.com wrote: From: steven mosher

Re: [R-sig-Geo] Archives Search Suggestion

2010-11-25 Thread Jacob van Etten
Using www.rseek.org is one way to reduce your carbon foodprint. --- On Thu, 25/11/10, Brian Oney zenli...@gmail.com wrote: From: Brian Oney zenli...@gmail.com Subject: [R-sig-Geo] Archives Search Suggestion To: r-sig-geo@stat.math.ethz.ch Date: Thursday, 25 November, 2010, 15:52 Hello List,

Re: [R-sig-Geo] Anyone attempted to animate multi-layered rasters?

2010-11-15 Thread Jacob van Etten
A function is not really necessary. It´s actually quite simple. library(raster) library(animation) setwd(c:/empty) logo - raster(system.file(external/rlogo.grd, package=raster), values=TRUE) saveMovie( for(i in 1:250) {     logo1 - logo     logo1[logo1i] - 0     #here you could also extract a

Re: [R-sig-Geo] Anyone attempted to animate multi-layered rasters?

2010-11-15 Thread Jacob van Etten
, making an external install unnecessary. Jacob. --- On Mon, 15/11/10, Kevin Ummel kevinum...@gmail.com wrote: From: Kevin Ummel kevinum...@gmail.com Subject: Re: [R-sig-Geo] Anyone attempted to animate multi-layered rasters? To: steven mosher mosherste...@gmail.com Cc: Jacob van Etten jacobvanet

Re: [R-sig-Geo] Bioclimatic variables - wettest quarter

2010-11-09 Thread Jacob van Etten
: From: Brian Oney zenli...@gmail.com Subject: Re: [R-sig-Geo] Bioclimatic variables - wettest quarter To: Jacob van Etten jacobvanet...@yahoo.com Cc: r-sig-geo@stat.math.ethz.ch Date: Tuesday, 9 November, 2010, 2:11 Hi Jacob, You are right it does produce a stack. I did

Re: [R-sig-Geo] Bioclimatic variables - wettest quarter

2010-11-08 Thread Jacob van Etten
I don´t know what the problem is with overlay(), but you could use an alternative approach, using calc() instead. Something like this (not tried) library(raster) library(dismo) func - function(x, ...) movingFun(x, n=3, sum, circular=TRUE) wetness_quarters - calc(mon_stac, func) wettest_quarter

Re: [R-sig-Geo] Bioclimatic variables - wettest quarter

2010-11-08 Thread Jacob van Etten
variables - wettest quarter To: Jacob van Etten jacobvanet...@yahoo.com Cc: r-sig-geo@stat.math.ethz.ch Date: Monday, 8 November, 2010, 14:48 Hi Jacob, Thanks for the suggestion. So... func - function(X) {x - movingFun(c(X), n=3, sum, 'from', circular=TRUE);return(x

Re: [R-sig-Geo] Bioclimatic variables - wettest quarter

2010-11-08 Thread Jacob van Etten
Oops, the function should of course be something like this: func - function(x) {   from - c(12,1:11)[x[13]]   to - c(2:12,1)[x[13]]   return(sum(x[c(from,x[13],to)])) } --- On Mon, 8/11/10, Jacob van Etten jacobvanet...@yahoo.com wrote: From: Jacob van Etten jacobvanet...@yahoo.com

Re: [R-sig-Geo] Apply a look-up table using Raster package

2010-09-13 Thread Jacob van Etten
Hi Ned, Function reclass() does this. Jacob. --- On Mon, 13/9/10, Ned Horning horn...@amnh.org wrote: From: Ned Horning horn...@amnh.org Subject: [R-sig-Geo] Apply a look-up table using Raster package To: r-sig-geo@stat.math.ethz.ch Date: Monday, 13 September, 2010, 22:16 Hi - Is it possible

Re: [R-sig-Geo] how to do randomly sampling in raster layer

2010-08-03 Thread Jacob van Etten
Dear Mao, This is an alternative approach, using only package raster and working with a lonlat grid. In a lonlat grid, cells represent different areas. Therefore, I randomly draw cells with probabilities relative to their area. I simply use the function sample() from base to do the sampling.

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 greenb...@ucdavis.edu wrote: From:

Re: [R-sig-Geo] Raster:memory or disk?

2010-06-30 Thread Jacob van Etten
r1 - raster(system.file(external/test.grd, package=raster)) r2 - r1 dataSource(r1) dataSource(r2) r2 has its data on disk. --- On Wed, 30/6/10, Agustin Lobo alobolis...@gmail.com wrote: From: Agustin Lobo alobolis...@gmail.com Subject: [R-sig-Geo] Raster:memory or disk? To: r-sig-geo

Re: [R-sig-Geo] distances values from a point exhibit a hexagon-like distribution

2010-06-22 Thread Jacob van Etten
Hi Roman, Nice picture. The help file says: Distances are calculated by summing local distances between cells, which are connected with their neighbours in 8 directions. Hence, you get a hexagonal shape if the grid doesn´t have any islands the shortest routes have to avoid. Perhaps

Re: [R-sig-Geo] projection() and proj4string()

2010-05-29 Thread Jacob van Etten
Hi Barry, What do you mean with a broken OO model? Best, Jacob. --- On Sat, 5/29/10, Barry Rowlingson b.rowling...@lancaster.ac.uk wrote: From: Barry Rowlingson b.rowling...@lancaster.ac.uk Subject: Re: [R-sig-Geo] projection() and proj4string() To: Agustin Lobo alobolis...@gmail.com Cc:

Re: [R-sig-Geo] Creating non-overlapping polygons from centroid with known size

2010-05-23 Thread Jacob van Etten
programme. ArcGis has this extension: http://www.geog.unt.edu/~pdong/software/VoronoiHelp.pdf I also found this document, which discusses free programmes (there are more!): http://giswin.geo.tsukuba.ac.jp/sis/tutorial/GISHint,fatemeh.pdf Good luck! Jacob van Etten --- On Sun, 5/23/10, Jens

Re: [R-sig-Geo] trying to plot listed RasterLayers

2010-05-14 Thread Jacob van Etten
This should work: plot(list.of.rasters[[1]]) You could also make a RasterStack instead of a list: r - raster(nrows=36, ncols=18) r - setValues(r, runif(ncell(r))) r4 - stack(r,r,r,r) plot(r4) #extract first layer and plot plot(raster(r4,1)) See also: ?addLayer Best, Jacob. --- On Fri,

Re: [R-sig-Geo] Region raster

2010-05-14 Thread Jacob van Etten
One way of doing this is by using the package raster. Take a look at: ?zonal Jacob. --- On Fri, 5/14/10, Raphael Saldanha saldanha.plan...@gmail.com wrote: From: Raphael Saldanha saldanha.plan...@gmail.com Subject: [R-sig-Geo] Region raster To: r-sig-geo r-sig-geo@stat.math.ethz.ch Date:

Re: [R-sig-Geo] raster sizes

2010-04-28 Thread Jacob van Etten
Dear Roman,   raster can deal with rasters that don´t fit in RAM.  A 1 million cell raster fits in RAM, so I would consider this small.   Jacob. --- On Wed, 4/28/10, Roman Luštrik roman.lust...@gmail.com wrote: From: Roman Luštrik roman.lust...@gmail.com Subject: [R-sig-Geo] raster

Re: [R-sig-Geo] Suggestion to build a Special Filter for a Raster classification

2010-04-13 Thread Jacob van Etten
The function focal() does these types of operations. Raster algebra and boolean operations do the rest. library(raster) va - c(0,0,0,0,0,0,0,0,0,0,0,1,0,0, 0,1,0,0,0,0,     0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,     0,0,1,1,1,1,1,1,1,1,1,0,1,0,1,1,1,1,1,0,    

Re: [R-sig-Geo] kriging as fish swim, not as crows fly

2010-01-29 Thread Jacob van Etten
With package gdistance, currently under development on R-Forge, it is possible to calculate a number of non-Euclidean distances, including the least-cost distance (based on package igraph), resistance distance, and (soon) randomised shortest paths. Jacob van Etten --- On Wed, 1/27/10, Pilar