# NOT RUN {
library(raster)
# create two raster stacks
for(i in 1:100)
{
mod <- raster::raster(matrix(runif(100,-1,1), ncol=10))
ref <- raster::raster(matrix(runif(100,-2,2), ncol=10))
assign(paste('mod', i , sep='_'), mod)
assign(paste('ref', i , sep='_'), ref)
}
my.list.mod <- lapply(ls(pattern='mod_'), get)
my.list.ref <- lapply(ls(pattern='ref_'), get)
mod <- do.call(stack, my.list.mod)
ref <- do.call(stack, my.list.ref)
# compute RMSE
rmse <- intFun.rmse(mod,ref)
plot(rmse); text(rmse, digits=2)
# }
Run the code above in your browser using DataLab