Skip to contents

helps other functions have flexible input parameters - can provide points in a table, points as lat,lon vectors, polygons in a spatial data.frame, or Census units as a fips code vector figures out which type of inputs were provided, and returns them

Usage

sites_from_input(
  sitepoints = NULL,
  lat = NULL,
  lon = NULL,
  shapefile = NULL,
  fips = NULL
)

Arguments

sitepoints

optional data.frame with colnames lat,lon

lat, lon

optional vectors of latitudes and longitudes

shapefile

optional polygons in a spatial data.frame

fips

optional Census units as a fips code vector

Value

a list with names sitetype, sitepoints, fips, and shapefile. sitetype is "latlon" or "fips" or "shp" or NULL others are NULL except the one corresponding to the sitetype sitepoints would be a data.frame of points in columns lat,lon or NULL shapefile would be a spatial data.frame "sf" class or NULL fips would be a vector of Census FIPS codes or NULL