[R] Use calc function to do RKT over raster stack

hendricks alyssa.hendricks at colostate.edu
Tue Jan 28 02:38:25 CET 2014

I am trying to do the Mann-Kendall, Sen's Slope and Regional Kendall Test
(rkt package) over a 30 year time period spatially. 

I have created a raster stack but am unable to figure out how to use the
calc function to do rkt.

This is what I have...

#create vector of years for tests
Years <- c(1978:2007)

#create stack of rasters

##create function of rkt package
MK_test <- function(x,y){rkt(x,y)}

ThirtyYr.mk <-calc(ThirtyYrStack,MK_test(Years,ThirtyYrStack))

I guess I am confused on what to pass into calc. I don't think the problem
is with the stack itself


View this message in context: http://r.789695.n4.nabble.com/Use-calc-function-to-do-RKT-over-raster-stack-tp4684265.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list