countries {red} | R Documentation |
Countries of occurrence.
Description
Extracts the names or ISO codes of countries of occurrence of a species based on either records or predicted distribution.
Usage
countries(spData, zone = NULL, ISO = FALSE)
Arguments
spData |
One of three options: 1) matrix of longitude and latitude (two columns) of each occurrence record; 2) matrix of easting and northing (two columns, e.g. UTM) of each occurrence record in meters; 3) RasterLayer object of predicted distribution (0/1 values). |
zone |
UTM zone if data is in metric units. |
ISO |
Outputs either country names (FALSE) or ISO codes (TRUE). |
Details
Country boundaries and designations are based on data(worldborders) from package maptools.
Value
A vector with country names or codes.
Examples
records = red.examples("red.records")
range = red.examples("red.range")
countries(records)
countries(range, ISO = TRUE)
[Package red version 1.6.1 Index]