Learn R Programming

WES (version 1.0.0)

get_admin_data: Get administrative data for a set of points

Description

This function takes a set of longitude and latitude coordinates and retrieves the administrative units that each point lies within.

Usage

get_admin_data(lon, lat, path_admin_data)

Value

data.frame

Arguments

lon

A numeric vector giving the longitude of the sampling sites in Decimal Degrees.

lat

A numeric vector giving the latitude of the sampling sites in Decimal Degrees.

path_admin_data

The file path to the admin data. Note that the function expects .shp format output from the download_admin_data function or from another user supplied source.

Examples

Run this code
# \donttest{

download_admin_data(iso3 = "MCO",
                    release = 'gbOpen',
                    path_output = tempdir())

get_admin_data(lon = c(7.416, 7.434),
               lat = c(43.734, 43.747),
               path_admin_data = file.path(tempdir(), 'MCO_admin_levels.shp'))

# }

Run the code above in your browser using DataLab