Learn R Programming

rworldmap (version 1.01)

mapHalfDegreeGridToCountries: Maps user half degree gridded data at country level by first aggregating.

Description

Maps user half degree gridded data at country level by first aggregating.

Usage

mapHalfDegreeGridToCountries(
      inFile=""
    , aggregateOption="sum"  
    , nameCountryColumn = ""
    , suggestForFailedCodes = FALSE 
    , projection=NA   
    , mapResolution="low"                                                 
    , numCats = 7 
    , xlim=c(-160,160)
    , ylim=c(-80,90)
    , mapRegion = "world"   
    , catMethod="quantiles"   
    , colourPalette= "heat" 
    , addLegend=TRUE 
    )

Arguments

inFile
either a gridascii filename or an sp SpatialGridDataFrame object specifying a global half degree grid dataset, if none specified an internal example data is used
aggregateOption
how to aggregate the data ('sum','mean','min','max')
nameCountryColumn
optional name of column containing country names (used in reporting of success/failure)
suggestForFailedCodes
T/F whether you want system to suggest for failed codes NOT YET WORKING
projection
deprecated june 2012
mapResolution
options low, medium, only for projection='none' initially
numCats
number of categories, may be overided e.g. if catMethod ='pretty'
xlim
map extents c(west,east), can be overidden by mapRegion
ylim
map extents c(south,north), can be overidden by mapRegion
mapRegion
'world','africa','oceania','eurasia','uk' sets map extents, overrides we,ea etc.
catMethod
method for categorisation of data "pretty", any vector defining breaks, "fixedWidth","quantiles"
colourPalette
"heat","white2Black","palette":for current palette
addLegend
whether to add a legend or not T/F

Value

  • invisibly returns a list containing the data and main options used for the map, the list can be passed to addMapLegend along with additional options to allow greater flexibility in legend creation.

Details

Aggregates half degree gridded data to countries using the option specified in 'aggregateOption' then maps at a country level.

See Also

aggregateHalfDegreeGridToCountries

Examples

Run this code
data(gridExData,envir=environment(),package="rworldmap")
gridExData <- get("gridExData")
mapHalfDegreeGridToCountries(gridExData)             

#different aggregate option
mapHalfDegreeGridToCountries( gridExData, aggregateOption="mean" )

Run the code above in your browser using DataLab