maps (version 2.0-11)

area.map: Area of map regions

Description

Computes the areas of regions in a map.

Usage

area.map(m, regions = ".", ...)

Arguments

m
a map object containing named polygons (created with fill = TRUE).
regions
a character vector naming one of more regions, as in map.
...
additional arguments to match.map

Value

  • a named vector of region areas.

Details

The area of each matching region in the map is computed, and regions which match the same element of regions have their areas combined. Each region is assumed planar, with vertices specified by the x and y components of the map object.

Note that map returns projected coordinates, so running area.map on the output of map gives the area of a region after it is projected onto the screen. If the projection is area-preserving (such as albers), then the area on the screen will match the area on the globe, up to a constant. The coordinates from map are also affected by its resolution argument (use resolution=0 for the most accurate areas).

See Also

area.polygon, apply.polygon

Examples

Run this code
# because the projection is rectangular, these are not true areas on the globe.
m = map("state", fill = TRUE)
area.map(m)
area.map(m, ".*dakota")
area.map(m, c("North Dakota", "South Dakota"))

Run the code above in your browser using DataLab