intFun.grid.wilcox: Wilcox significance test

Description Usage Arguments Value Examples

View source: R/intFun.R

Description

This function conducts the Wilcox two-sided significance test for two data sets that are stored in a single raster stack. The resulting raster object shows the corresponding p-value.

Usage

1

Arguments

x

A raster stack object

Value

A raster object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
library(raster)
# create a raster stack
for(i in 1:100)
{
 data <- raster::raster(matrix(runif(100,0,1), ncol=10))
 assign(paste('layer', i , sep='_'), data)
}
my.list <- lapply(ls(pattern='layer_'), get)
data <- do.call(stack, my.list)
# define a, b, and c
a <- nlayers(data)/2
b <- a+1
c <- nlayers(data)
a;b;c
# conduct two-sided Wilcox significance test
pvalue <- calc(data, intFun.grid.wilcox)
plot(pvalue); text(data, digits=2)

amber documentation built on Aug. 28, 2020, 5:08 p.m.