add_country_names: Add country names to a data table with lon/lat coordinates

View source: R/utils.R

add_country_namesR Documentation

Add country names to a data table with lon/lat coordinates

Description

Takes a data table with lon/lat coordinates and adds a column 'country' to it, containing the name of the country, the coordinate belongs to.

Usage

add_country_names(dt, regions = EA_country_names())

Arguments

dt

the data table.

regions

Character vector of country names for which shapefiles are loaded. By default, countries in East Africa are loaded, see EA_country_names. If you set regions = '.', the entire world is loaded, but this makes the function slower.

Value

The provided data table with an extra column with country names

Examples

dt = add_country_names(chirps_monthly)


SeaVal documentation built on June 24, 2024, 5:15 p.m.