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
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,
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
, 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
:
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
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
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
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
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
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.
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:
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
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
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:
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
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,
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:
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
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,
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
20 matches
Mail list logo