assignPolys | R Documentation |
This function assigns spatial polygon data to water quality portal type site objects (or data with site information attached).
assignPolys(
data,
polygon,
lat = "LatitudeMeasure",
long = "LongitudeMeasure",
columns
)
data |
Input dataset. Must include latitude & longitude columns. |
polygon |
Polygon to assign information to sites. Must be an sf type polygon shapefile, WGS84 projection recommended. |
lat |
Name of latitude column. Default matches WQP objects. |
long |
Name of longitude column. Default matches WQP objects. |
columns |
Vector of columns to retain from polygon object. If columns not specified, function will retain all columns. |
Returns the input data frame with assessment unit information appended.
# Read a couple of sites (Mantua Reservoir and a tributary)
sites=readWQP(type="sites", siteid=c("UTAHDWQ_WQX-4900440","UTAHDWQ_WQX-4900470"))
sites_AUs=assignPolys(sites, wqTools::au_poly)
sites_BUs=assignPolys(sites, wqTools::bu_poly)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.