getVariable: Return SPDF variable at specified locations

Description Usage Arguments Value See Also Examples

View source: R/getVariable.R

Description

Uses spatial comparison to determine which polygons the locations fall into and returns the variable associated with those polygons.

If allData = TRUE, the entire dataframe is returned.

Usage

1
2
getVariable(lon, lat, dataset = NULL, variable = NULL,
  countryCodes = NULL, allData = FALSE)

Arguments

lon

vector of longitudes in decimal degrees

lat

vector of latitudes in decimal degrees

dataset

name of spatial dataset to use

variable

name of dataframe column to be returned

countryCodes

vector of countryCodes

allData

logical specifying whether a full dataframe should be returned

Value

Vector or dataframe.

See Also

getSpatialData

Examples

1
2
3
4
5
6
7
## Not run: 
loadSpatialData("NaturalEarthAdm1")
lon <- seq(0, 50)
lat <- seq(0, 50)
getVariable(lon, lat, "NaturalEarthAdm1", "gns_lang")

## End(Not run)

MazamaSpatialUtils documentation built on Sept. 29, 2019, 1:03 a.m.