Title: | National Eutrophication Survey Data |
---|---|
Description: | Serves data from the United States Environmental Protection Agency (USEPA) National Eutrophication Survey <https://www.epa.gov/national-aquatic-resource-surveys>. |
Authors: | Jemma Stachelek [aut, cre] |
Maintainer: | Jemma Stachelek <[email protected]> |
License: | GPL |
Version: | 0.3.1 |
Built: | 2024-11-03 03:05:03 UTC |
Source: | https://github.com/jsta/nesrdata |
Return path to OS agnostic cache location specified by the rappdirs package
cache_path()
cache_path()
A dataset containing hydrologic and water quality data for approximately 800 lakes in the continental United States.
nes
nes
An object of class data.frame
with 775 rows and 39 columns.
variable name | description | units |
pdf identifier (474 - 477) | integer | |
pagenum | page number of the pdf (not the report page number) | integer |
storet_code | identifier which links measurement to coordinate locations | character |
state | state where the water body resides | character |
name | name of the water body | character |
county | county where the water body resides | character |
lake_type | natural or impoundment | character |
drainage_area | the total drainage area | square kilometers |
surface_area | the area of the water surface | sq km |
mean_depth | the volume of the water body divided by the surface area in square meters | meters |
total_inflow | the mean of the inflows of all tributaries and the immediate drainage | cubic meters per second |
retention_time | a mean value determined by dividing the lake volume, in cubic meters, by the mean annual outflow in cubic meters per unit of time in years or days | |
retention_time_units | the units of time for each retention entry | years or days |
alkalinity | alkalinity | milligrams per liter |
conductivity | conductivity | microohms |
secchi | secchi | meters |
tp | total phosphorus | milligrams per liter |
po4 | orthophosphate | milligrams per liter |
tin | total inorganic nitrogen | milligrams per liter |
tn | total nitrogen | milligrams per liter |
p_pnt_source_muni | municipal point source phosphorus loading | kilograms per year |
p_pnt_source_industrial | industrial point source phosphorus loading | kilograms per year |
p_pnt_source_septic | septic point source phosphorus loading | kilograms per year |
p_nonpnt_source | nonpoint source phosphorus loading | kilograms per year |
p_total | total phosphorus loading | kilograms per year |
n_pnt_source_muni | municipal point source nitrogen loading | kilograms per year |
n_pnt_source_industrial | industrial point source nitrogen loading | kilograms per year |
n_pnt_source_septic | septic point source nitrogen loading | kilograms per year |
n_nonpnt_source | nonpoint source nitrogen loading | kilograms per year |
n_total | total nitrogen loading | kilograms per year |
p_total_out | total phosphorus outlet load | kilograms per year |
p_percent_retention | percent phosphorus retention | percent |
p_surface_area_loading | phosphorus surface area loading | grams per square meter per year |
n_total_out | total nitrogen outlet load | kilograms per year |
n_percent_retention | percent nitrogen retention | percent |
n_surface_area_loading | nitrogen surface area loading | grams per square meter per year |
lat | latitude | decimal degrees |
long | longitude | decimal degrees |
data(nes) head(nes)
data(nes) head(nes)
Compile data from component flat files
nes_compile(version_id, format = "rds", folder = tempdir(), skip = NA)
nes_compile(version_id, format = "rds", folder = tempdir(), skip = NA)
version_id |
character nes version string |
format |
character choice of "rds" or "sqlite" |
folder |
file.path to data folder; set to cache_path() to have data persist between sessions. |
skip |
numeric vector of lines to skip on file read. optional. |
## Not run: nes_get("1") nes_compile("1", format = "rds") nes_get("1", dest_folder = cache_path(), compile = FALSE) nes_compile("1", folder = cache_path()) ## End(Not run)
## Not run: nes_get("1") nes_compile("1", format = "rds") nes_get("1", dest_folder = cache_path(), compile = FALSE) nes_compile("1", folder = cache_path()) ## End(Not run)
Retrieves external files and store in file cache.
nes_get(version_id, dest_folder = tempdir(), skip = NA, compile = TRUE)
nes_get(version_id, dest_folder = tempdir(), skip = NA, compile = TRUE)
version_id |
character version id |
dest_folder |
file.path optional will default to the location returned by |
skip |
numeric vector of lines to skip on file read. optional. |
compile |
logical perform on-the-fly compilation to rds? |
## Not run: nes_get(version_id = "5") # save to temp folder nes_get(version_id = "5", dest_folder = cache_path()) # save to cache folder ## End(Not run)
## Not run: nes_get(version_id = "5") # save to temp folder nes_get(version_id = "5", dest_folder = cache_path()) # save to cache folder ## End(Not run)
Ingest data from component flat files
nes_ingest(version_id, folder = NA, skip = NA)
nes_ingest(version_id, folder = NA, skip = NA)
version_id |
character nes version string |
folder |
file.path to data folder. optional. |
skip |
numeric vector of lines to skip on file read. optional. |
## Not run: nes_ingest("1") ## End(Not run)
## Not run: nes_ingest("1") ## End(Not run)
Load files from local file system
nes_load(version_id, folder = tempdir(), format = "rds", fpath = NA)
nes_load(version_id, folder = tempdir(), format = "rds", fpath = NA)
version_id |
character database version string |
folder |
file.path to data folder; use cache_path() to load cached (non-temporary) data |
format |
character choice of rds or sqlite |
fpath |
file.path optionally specify custom location of rds file |
## Not run: # load from tempdir nes_get("5") dt <- nes_load("5") # load from cached nes_get("5", dest_folder = cache_path()) dt <- nes_load("5") ## End(Not run)
## Not run: # load from tempdir nes_get("5") dt <- nes_load("5") # load from cached nes_get("5", dest_folder = cache_path()) dt <- nes_load("5") ## End(Not run)
nes_ls
nes_ls(version_id, folder = temp_path(), ...)
nes_ls(version_id, folder = temp_path(), ...)
version_id |
character version id |
folder |
file.path to NES data; pass cache_path() to use OS agnostic cache location specified by the rappdirs package. |
... |
extra arguments passed to list.files |
nes_ls("1")
nes_ls("1")
nes_versions
nes_versions()
nes_versions()
nes_versions()
nes_versions()