[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
ThirtyYrStack
<-stack(Map1978,Map1979,Map1980,Map1981,Map1982,Map1983,Map1984,Map1985,Map1986,Map1987,Map1988,Map1989,Map1990,Map1991,Map1992,Map1993,Map1994,Map1995,Map1996,Map1997,Map1998,Map1999,Map2000,Map2001,Map2002,Map2003,Map2004,Map2005,Map2006,Map2007)

##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

Alyssa




--
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