I am getting familiar with raster package. so this may not be the most  
elegant way

flipBrick <- function(x, direction="x"){
  br <- brick(raster(extent(x), nrow=nrow(x), ncol=ncol(x),  
crs=projection(x)))
        for(i in 1:nlayers(x)){
                k <- flip(raster(x,i),direction)
                br <- addLayer(br,k)
                }
return(br)
        }



Nikhil Kaza
Asst. Professor,
City and Regional Planning
University of North Carolina

nikhil.l...@gmail.com

On Sep 21, 2010, at 3:49 AM, Martin wrote:

>
> Dear all,
>
> I have some questions concerning stacks and bricks from the raster  
> package.
>
> 1. is it possible to flip the whole stack vertically? I get an error  
> when I
> use the 'flip' function..
>
> 2. is it possible to use the calc function (or something else) on a  
> stack to
> get a raster, which shows the regression slope of the pixels through  
> the
> stack (treated like a kind of time series)? And is it possible to  
> compute a
> correlation between two stacks of the same dimensions?
>
> greetings,
> Martin
>
>
> -- 
> View this message in context: 
> http://r-sig-geo.2731867.n2.nabble.com/questions-on-RasterStack-Brick-tp5553580p5553580.html
> Sent from the R-sig-geo mailing list archive at Nabble.com.
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo


        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to