mapHalfDegreeGridToCountries {rworldmap} | R Documentation |
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,
lwd = 0.5
)
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 |
lwd |
line width for country borders |
Details
Aggregates half degree gridded data to countries using the option specified in 'aggregateOption' then maps at a country level.
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.
Author(s)
andy south #@importFrom maptools readAsciiGrid
See Also
aggregateHalfDegreeGridToCountries
Examples
data(gridExData,envir=environment(),package="rworldmap")
gridExData <- get("gridExData")
mapHalfDegreeGridToCountries(gridExData)
#different aggregate option
mapHalfDegreeGridToCountries( gridExData, aggregateOption="mean" )