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 wrote:
From: steven mosher
Subject: Re: [R-sig-
Using www.rseek.org is one way to reduce your carbon foodprint.
--- On Thu, 25/11/10, Brian Oney wrote:
From: Brian Oney
Subject: [R-sig-Geo] Archives Search Suggestion
To: r-sig-geo@stat.math.ethz.ch
Date: Thursday, 25 November, 2010, 15:52
Hello List,
Sorry if this is just spam.
Maybe I coul
, making an external install unnecessary.
Jacob.
--- On Mon, 15/11/10, Kevin Ummel wrote:
From: Kevin Ummel
Subject: Re: [R-sig-Geo] Anyone attempted to "animate" multi-layered rasters?
To: "steven mosher"
Cc: "Jacob van Etten" , R-sig-Geo@stat.math.ethz.ch,
x.
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[logo1 wrote:
From: Kevin Ummel
Subject
om: Brian Oney
Subject: Re: [R-sig-Geo] Bioclimatic variables - wettest quarter
To: "Jacob van Etten"
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 not know that calc can
handle a co
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 wrote:
From: Jacob van Etten
Subject: Re: [R-sig-Geo] Bi
ney
Subject: Re: [R-sig-Geo] Bioclimatic variables - wettest quarter
To: "Jacob van Etten"
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, su
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_quarte
Hi Ned,
Function reclass() does this.
Jacob.
--- On Mon, 13/9/10, Ned Horning wrote:
From: Ned Horning
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 to modify a Raster layer using a
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.
l
Strange. It looks as if the projection slot holds something that is not of
class CRS.
Could you make a reproducible example (a small raster with the same projection)?
Using show (= just the name of the raster) gives more useful information about
the raster than summary().
Jacob.
--- On Wed,
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
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 wrote:
From: Agustin Lobo
Subject: [R-sig-Geo] Raster:memory or disk?
To: "r-sig-geo"
Cc: agustin.l...@ija.csic.es
Date: Wednesd
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 dist
Hi Barry,
What do you mean with a broken OO model?
Best,
Jacob.
--- On Sat, 5/29/10, Barry Rowlingson wrote:
From: Barry Rowlingson
Subject: Re: [R-sig-Geo] projection() and proj4string()
To: "Agustin Lobo"
Cc: r-sig-geo@stat.math.ethz.ch
Date: Saturday, May 29, 2010, 7:10 PM
On Sat, May
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
One way of doing this is by using the package raster.
Take a look at:
?zonal
Jacob.
--- On Fri, 5/14/10, Raphael Saldanha wrote:
From: Raphael Saldanha
Subject: [R-sig-Geo] Region raster
To: "r-sig-geo"
Date: Friday, May 14, 2010, 2:53 PM
Dear list,
I'm completely newbie with working with
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, 5/
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 wrote:
From: Roman Luštrik
Subject: [R-sig-Geo] raster sizes
To: "r-sig-geo"
Date: Wednesday, April 28, 2
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,
0,0,1,1,1,1,1,1,1,1,
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
As the Wikipedia article on great-circle distances explains very well, there is
a trade-off between local accuracy, long-distance accuracy, and computational
effort. Therefore, I don´t think it is a simple matter of better or worse, but
what formula/function is fit for your purpose.
Jacob.
---
22 matches
Mail list logo