aggregateHalfDegreeGridToCountries: Aggregates global half degree gridded data to countries

Description Usage Arguments Value Author(s) See Also Examples

Description

Aggregates global half degree gridded data to countries (options for sum, mean, min, max ). Uses a very simple grid map defining a single country identity for each half degree cell. (other more sophisticated approaches dividing cells between multiple countries will be investigated in future). The country identity at each cell is specified in data(gridCountriesDegreesHalf).

Usage

1
aggregateHalfDegreeGridToCountries(inFile = "", aggregateOption = "sum")

Arguments

inFile

either a gridascii filename or an sp SpatialGridDataFrame object specifying a global half degree grid dataset

aggregateOption

how to aggregate the data ('sum','mean','min','max')

Value

a dataframe with 2 columns : numeric country codes and the aggregated value for each country

Author(s)

andy south

See Also

mapHalfDegreeGridToCountries

Examples

1
2
3
4
5
6
7
8
data(gridExData,envir=environment(),package="rworldmap")
gridExData <- get("gridExData")
#aggregating the gridded data to countries
dF <- aggregateHalfDegreeGridToCountries(gridExData)
#joining the aggregated data to a country map
sPDF <- joinCountryData2Map(dF, nameJoinColumn='UN', joinCode='UN')
#plotting the map
mapCountryData(sPDF,nameColumnToPlot='sum_pa2000.asc')


Search within the rworldmap package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.