| 12 | |
| 13 | The total precipitation field is calculated as the total accumulated precipitation during the selected period for each model grid cell: |
| 14 | |
| 15 | {{{ |
| 16 | tp <- colSums(monsoon$MemberData$Member_16) |
| 17 | }}} |
| 18 | |
| 19 | And this is the classical way of displaying the data using the `spplot` method: |
| 20 | |
| 21 | {{{ |
| 22 | sgdf <- SpatialGridDataFrame(monsoon$LonLatCoords, as.data.frame(tp)) |
| 23 | data(world_map) |
| 24 | wl <- as(world_map, "SpatialLines") |
| 25 | wlines <- list("sp.lines", wl) |
| 26 | spplot(sgdf, scales = list(draw = TRUE), sp.layout = list(wlines), col.regions = rev(topo.colors(41))) |
| 27 | }}} |
| 28 | |
| 29 | [[Image(spplot.png)]] |
| 30 | |
| 31 | It is also straightforward to represent the precipitation using contour lines: |
| 32 | |
| 33 | {{{ |
| 34 | spplot(sgdf, scales = list(draw = TRUE), contour = TRUE, col = "red", col.regions = rev(topo.colors(41))) |
| 35 | }}} |
| 36 | |
| 37 | [[Image(spplot_contour.png)]] |
| 38 | |
| 39 | |
| 40 | |
| 41 | |