Learn R Programming

red (version 0.2.0)

countr: 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

countr(spData, ISO = FALSE)

Arguments

spData
Either a matrix of longitude and latitude (two columns) of each occurrence record or a presence/absence map as a RasterLayer object.
ISO
Outputs either country names (FALSE) or ISO codes (TRUE).

Value

A vector with country names or codes.

Details

Country boundaries and designations are based on data(data.worldborders) from package maptools.

Examples

Run this code
data(data.records)
data(data.sp)
countr(data.records)
countr(data.sp, ISO = TRUE)

Run the code above in your browser using DataLab