Changes between Version 14 and Version 15 of udg/ecoms/RPackage/examples/continentalSelection
- Timestamp:
- Sep 2, 2014 6:08:45 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
udg/ecoms/RPackage/examples/continentalSelection
v14 v15 81 81 }}} 82 82 83 [[Image(image-20140902-172548.png)]] 83 84 [[Image(image-20140902-172529.png)]] 84 85 85 86 … … 88 89 {{{ 89 90 #!text/R 90 ref <- apply(obs.regridded$Data, MARGIN = c(3,2), mean, na.rm = TRUE)91 > ref <- apply(obs.regridded$Data, MARGIN = c(3,2), mean, na.rm = TRUE) 91 92 }}} 92 93 94 The following lines of code compute the bias of each member w.r.t. the reference and plot them: 93 95 96 {{{ 97 #!text/R 98 # Now we compute the difference agains each of the multimember spatial means: 99 > require(fields) 100 > n.members <- dim(ex2$Data)[1] 101 > par(mfrow = c(1,2)) 102 > for (i in 1:n.members) { 103 + member <- apply(ex2$Data[i, , , ], MARGIN = c(3,2), mean, na.rm = TRUE) 104 + bias <- member - ref 105 + image.plot(ex2$xyCoords$x, ex2$xyCoords$y, bias, xlab = "lon", ylab = "lat", asp = 1) 106 + title(paste("Bias member", i)) 107 + world(add = TRUE) 108 + } 109 > par(mfrow = c(1,1)) # To reset the graphical window 110 }}} 111 112 [[Image(image-20140902-180232.png)]] 113 114 115