Changes between Version 14 and Version 15 of udg/ecoms/RPackage/examples/continentalSelection


Ignore:
Timestamp:
Sep 2, 2014 6:08:45 PM (7 years ago)
Author:
juaco
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • udg/ecoms/RPackage/examples/continentalSelection

    v14 v15  
    8181}}}
    8282
    83 [[Image(image-20140902-172548.png)]]
     83
     84[[Image(image-20140902-172529.png)]]
    8485
    8586
     
    8889{{{
    8990#!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)
    9192}}}
    9293
     94The following lines of code compute the bias of each member w.r.t. the reference and plot them:
    9395
     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