located_in_shapefile: Locations In the Shapefile

View source: R/located_in_shapefile.R

located_in_shapefileR Documentation

Locations In the Shapefile

Description

Creates a new column (in_shape) that tells whether the lat/long is in a certain shapefile.

Usage

located_in_shapefile(
  .,
  lat_column = "lat",
  lng_column = "lng",
  shapefile = NA,
  shapefile_name = NA
)

Arguments

.

Data Frame that has been locationized. see weed::split_locations

lat_column

Name of column containing Latitude data

lng_column

Name of column containing Longitude data

shapefile

The shapefile itself (either shapefile or shapefile_name must be provided)

shapefile_name

FileName/Path to shapefile (either shapefile or shapefile_name must be provided)

Value

Data Frame with the shapefile data as well as the previous data

Examples

## Not run: 
d <- tibble::tribble(
~value,  ~location_word,                    ~Country,     ~lat,       ~lng,
"city of new york",      "new york",                       "USA", 40.71427,  -74.00597,
"kerala, chennai municipality, and san francisco",  "kerala", "India", 10.41667,       76.5,
"kerala, chennai municipality, and san francisco",  "chennai",  "India", 13.08784,   80.2847)
located_in_shapefile(d,
lat_column = "lat",
lng_column = "lng",
shapefile_name = "~/dummy_name")

## End(Not run)

weed documentation built on Oct. 17, 2023, 1:06 a.m.