Changes between Version 42 and Version 43 of udg/ecoms/RPackage/examples


Ignore:
Timestamp:
Feb 14, 2014 3:05:53 PM (8 years ago)
Author:
juaco
Comment:

--

Legend:

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

    v42 v43  
    1 # EXAMPLE: Loading and plotting various members:
     1= EXAMPLE 1: Loading and plotting various members
    22
    3 # Total precipitation of January 2010 forecasted in October 2009 (lead month 3) by the System4 model (seasonal range, 15 members) 
    4 # is next represented for each member, using the spplot method for the SPatialGridDataFrame class of library sp:
     3Total precipitation at the Gulf of Guinea for January 2010 forecasted in October 2009 (lead month 3) by the System4 model (seasonal range, 15 members) is next represented for each member, using the `spplot` method for the `SpatialGridDataFrame` class of library `sp`:
    54
    6 gg.pr <- loadSeasonalForecast("System4_seasonal_15", var="tp", members=NULL, lonLim=c(-30,20), latLim=c(-12,15), season=1, years=2010, leadMonth=3)
     5Data are loaded by introducing the required values for dataset, spatio-temporal window and lead month definition. Note that the argument `members` is omitted, which means that by default all available members (15 in this case, will be returned).
    76
     7{{{
     8> gg.pr <- loadSeasonalForecast("System4_seasonal_15", var="tp", lonLim=c(-30,20),
     9+ latLim=c(-12,15), season=1, years=2010, leadMonth=3)
     10
     11}}}
     12
     13{{{
    814names(gg.pr)
    915str(gg.pr$MemberData)
     16}}}
    1017
    1118
     19{{{
    1220pr.list <- lapply(1:length(gg.pr$MemberData), function(x) colSums(gg.pr$MemberData[[x]]))
    1321df <- do.call("data.frame", pr.list)
    1422names(df) <- names(gg.pr$MemberData)
     23}}}
    1524
     25{{{
    1626class(gg.pr$LonLatCoords)
    1727sgdf <- SpatialGridDataFrame(gg.pr$LonLatCoords, df)
     28}}}
    1829
     30{{{
    1931spplot(sgdf, scales=list(draw = TRUE), col.regions = rev(terrain.colors(50)), at = seq(0, ceiling(max(sgdf@data)),10))
     32}}}
    2033
     34[[Image(GulfOfGuinea15members.png)]]
    2135
    2236data(world_map)