View source: R/get_site_coords.R
get_site_coords | R Documentation |
Pull the latitude and longitude of a site from ScienceBase
get_site_coords(site_names, format = c("normal", "geoknife"),
on_missing = c("NA", "omit"), out = c("site_name", "lat", "lon"),
use_basedon = FALSE, attach.units = (format == "normal"))
site_names |
a list of site names such as those returned from make_site_name() |
format |
character specifying the desired output format. normal is a human-readable, dplyr-friendly format. geoknife works well for geoknife and excludes sites with incomplete coordinate data. |
on_missing |
character specifying how to treat missing sites. Use "NA" to include missing sites in the output but with NA for both lon and lat. Use "omit" to omit those sites from the output. |
out |
vector of column names to include in the output; only honored if format=='normal' |
use_basedon |
logical. If TRUE, and if there are sites among site_names that have NA in their lat or lon fields but also have a character value in their styx.basedon metadata field, then lat and lon will be pulled from the site named in styx.basedon. use_basedon=TRUE is appropriate primarily for styx sites (those with simulated data, whose initial data are based on some real site) and so use_basedon=FALSE by default. |
attach.units |
logical. Should units be attached? |
a data.frame of site names and coordinates, with units if attach.units=TRUE, or a matrix if format='geoknife'
get_site_coords(c("nwis_01467200","nwis_351111089512501","nwis_07239450"))
get_site_coords(c("styx_001001","nwis_07239450"), use_basedon=TRUE)
get_site_coords(c("nwis_01467200","nwis_09327000","nwis_351111089512501",
"styx_000001001"), format="geoknife")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.