Skip to content
Prev 25398 / 29559 Next

Calculate anomalies on time-series rasters

Thanks for the input, Michael and Loic.

It looks like remote's "anomalize" might work, but the overlay approach was more convenient to use based on the shape of my data.
 
Greetings,
 -- Thiago V. dos Santos

PhD student
Land and Atmospheric Science
University of Minnesota
On Sunday, February 12, 2017 5:24 PM, Lo?c Dutrieux <loic.dutrieux at conabio.gob.mx> wrote:

        
On 12/02/2017 03:14, Michael Sumner wrote:
If you're confident about the order of the layers in your rasterStacks
you could use overlay. See the note about recycling in the function help.

# lenght(x) needs to be a multiple of length(y), so that it can be recycled
# e.g. c(10, 10, 10, 10, 10, 10) - c(5, 7)
fun <- function(x, y) {
  x - y
}

annomalies <- overlay(x = s91.2010, y = s61.90.mon, fun = fun)

However, it looks like your climatologies are in alphabetic and not
chronological order, so you'll have to double check that.

Cheers,
Lo?c

            
_______________________________________________
R-sig-Geo mailing list
R-sig-Geo at r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo