Title: | Collection of Datasets for the USGS-INL Monitoring Networks |
Version: | 1.2.7 |
Description: | A collection of analysis-ready datasets for the U.S. Geological Survey - Idaho National Laboratory (USGS-INL) groundwater and surface-water monitoring networks, administered by the USGS-INL Project Office in cooperation with the U.S. Department of Energy. The data collected from wells and surface-water stations at the Idaho National Laboratory and surrounding areas have been used to describe the effects of waste disposal on water contained in the eastern Snake River Plain aquifer, located in the southeastern part of Idaho, and the availability of water for long-term consumptive and industrial use. The package includes long-term monitoring records dating back to measurements from 1922. Geospatial data describing the areas from which samples were collected or observations were made are also included in the package. Bundling this data into a single package significantly reduces the magnitude of data processing for researchers and provides a way to distribute the data along with its documentation in a standard format. Geospatial datasets are made available in a common projection and datum, and geohydrologic data have been structured to facilitate analysis. |
Depends: | R (≥ 4.1) |
Imports: | checkmate, sf, stats, stringi, terra, tools, utils |
Suggests: | archive, arrow, connectapi, covr, curl, dataRetrieval, DiagrammeR, DiagrammeRsvg, dm, fontawesome, htmltools, htmlwidgets, httr, inlcolor, jsonlite, knitr, pkgload, pkgbuild, pkgdown, plotrix, rappdirs, rcmdcheck, reactable, renv, rmarkdown, roxygen2, rsconnect, tinytest, V8, webmap, writexl, xml2 |
License: | CC0 |
URL: | https://rconnect.usgs.gov/INLPO/inldata-main/, https://code.usgs.gov/inl/inldata |
BugReports: | https://code.usgs.gov/inl/inldata/-/issues |
Copyright: | This software is in the public domain because it contains materials that originally came from the United States Geological Survey (USGS), an agency of the United States Department of Interior. For more information, see the official USGS copyright policy at https://www.usgs.gov/information-policies-and-instructions/copyrights-and-credits |
Encoding: | UTF-8 |
SystemRequirements: | libcurl4-openssl-dev pandoc libarchive-dev libv8-dev (deb) |
LazyData: | true |
LazyDataCompression: | xz |
RoxygenNote: | 7.3.2 |
NeedsCompilation: | no |
Packaged: | 2024-07-31 15:22:54 UTC; jfisher |
Author: | Jason C. Fisher |
Maintainer: | Jason C. Fisher <jfisher@usgs.gov> |
Repository: | CRAN |
Date/Publication: | 2024-09-12 07:20:02 UTC |
inldata: Collection of Datasets for the USGS-INL Monitoring Networks
Description
A collection of analysis-ready datasets for the U.S. Geological Survey - Idaho National Laboratory (USGS-INL) groundwater and surface-water monitoring networks, administered by the USGS-INL Project Office in cooperation with the U.S. Department of Energy. The data collected from wells and surface-water stations at the Idaho National Laboratory and surrounding areas have been used to describe the effects of waste disposal on water contained in the eastern Snake River Plain aquifer, located in the southeastern part of Idaho, and the availability of water for long-term consumptive and industrial use. The package includes long-term monitoring records dating back to measurements from 1922. Geospatial data describing the areas from which samples were collected or observations were made are also included in the package. Bundling this data into a single package significantly reduces the magnitude of data processing for researchers and provides a way to distribute the data along with its documentation in a standard format. Geospatial datasets are made available in a common projection and datum, and geohydrologic data have been structured to facilitate analysis.
Author(s)
Maintainer: Jason C. Fisher jfisher@usgs.gov (ORCID)
Authors:
Allison R. Trcka atrcka@usgs.gov (ORCID)
Kerri C. Treinen ktreinen@usgs.gov (ORCID)
See Also
Useful links:
Report bugs at https://code.usgs.gov/inl/inldata/-/issues
Date-Time Conversion
Description
Convert calendar date and times.
Usage
as_posix_ct(dt, tm, tm_unset = "12:00", tz = "")
Arguments
dt |
'character' vector. Calendar date formatted as YYYY-MM-DD. |
tm |
'character' vector.
Time in Greenwich Mean Time (UTC) formatted as HH:MM.
Vector length equal to the length of |
tm_unset |
'character' string. Value if time is missing, noon by default. |
tz |
'character' string. Time zone specification to convert to. |
Value
Returns an object of class 'POSIXct'.
Author(s)
J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center
Examples
as_posix_ct(
dt = c("2024-01-01", "2024-02-15", NA),
tm = c("14:30", NA, "11:11"),
tz = "America/Denver"
)
Assert Existence of URL
Description
Assert that a Uniform Resource Locator (URL) is complete and valid. Requires that the httr package is available.
Usage
assert_url(url, ...)
Arguments
url |
'character' string. URL |
... |
Other arguments passed to the |
Value
Returns url
invisibly.
A NULL
value is returned if the assertion fails for any reason.
Source
Code adapted from Stack Overflow, accessed on 2023-12-11 and authored by Bob Rudis.
Examples
assert_url("https://www.usgs.gov/")
Background Concentrations
Description
Water-quality background concentrations for selected radionuclides, organic compounds, and chemical constituents that were analyzed for in water from the eastern Snake River Plain aquifer at and near the Idaho National Laboratory (INL). The background concentrations are defined as groundwater influenced by western tributary recharge in the western INL and by eastern regional recharge in the eastern INL. These concentrations are either naturally occurring or anthropogenic (substances present in the environment as a result of human activities) and are not influenced by waste and wastewater disposal at the INL, according to Bartholomay and Hall (2016).
Usage
background
Format
A data frame with columns:
parm_nm
Long parameter name, such as "Strontium-90, water, unfiltered, picocuries per liter".
pcode
U.S. Geological Survey 5-digit parameter code used to identify the constituent measured, see
parameters
dataset for details. For example, the parameter code for Tritium is "07000".bkgrd_min
Minimum limit of background concentration.
bkgrd_max
Maximum limit of background concentration.
reference
Source of background concentration limits. Reference citations are as follows: "Bartholomay and Hall (2016)", "Knobel and others (1992)", "Michel (1989)", and "Orr and others (1991)".
Source
Idaho National Laboratory Project Office
References
Bartholomay, R.C., and Hall, L.F., 2016, Evaluation of background concentrations of selected chemical and radiochemical constituents in groundwater in the eastern Snake River Plain aquifer at and near the Idaho National Laboratory, Idaho: U.S. Geological Survey Scientific Investigations Report 2016–5056, (DOE/ID–22237), 19 p., doi:10.3133/sir20165056.
Knobel, L.L., Orr, B.R., and Cecil, L.D., 1992, Summary of background concentrations of selected radiochemical and chemical constituents in groundwater from the Snake River Plain aquifer, Idaho: estimated from an analysis of previously published data: Journal of the Idaho Academy of Science, v. 28, no. 1, p. 48–61.
Michel, R.L., 1989, Tritium deposition in the continental United States, 1953–83: U.S. Geological Survey Water Resources Investigations Report 89–4072, 46 p., doi:10.3133/wri894072.
Orr, B.R., Cecil, L.D., and Knobel, L.L., 1991, Background concentrations of selected radionuclides, organic compounds, and chemical constituents in ground water in the vicinity of the Idaho National Engineering Laboratory: U.S. Geological Survey Water-Resources Investigations Report 91–4015 (DOE/ID–22094), 52 p., doi:10.3133/wri914015.
Examples
str(background)
Benchmark Concentrations
Description
Water-quality benchmark concentrations of selected radionuclides, organic compounds, and chemical constituents. These benchmarks include the United States Environmental Protection Agency (EPA) Maximum Contaminant Levels (MCLs), Human Health Benchmarks for Pesticides (HHBPs), and U.S. Geological Survey (USGS) Health-Based Screening Levels (HBSLs).
Usage
benchmarks
Format
A data frame with columns:
parm_nm
Long parameter name, such as "Strontium-90, water, unfiltered, picocuries per liter".
pcode
U.S. Geological Survey 5-digit parameter code used to identify the constituent measured, see
parameters
dataset for details. For example, the parameter code for Tritium is "07000".mcl
Maximum Contaminant Levels (MCLs), a standard set by the EPA for drinking water quality. An MCL is the legal threshold limit on the amount of a substance that is allowed in public water systems under the Safe Drinking Water Act.
hhbp_noncancer
EPA Chronic Noncancer HHBPs.
hhbp_cancer_min
EPA Carcinogenic HHBPs for a one-in-one million cancer risk.
hhbp_cancer_max
EPA Carcinogenic HHBPs for a one-in-ten thousand cancer risk.
hbsl_noncancer
USGS Noncancer HBSLs.
hbsl_cancer_min
USGS Cancer HBSLs for a one-in-one million cancer risk.
hbsl_cancer_max
USGS Cancer HBSLs for a one-in-ten thousand cancer risk.
remark
Benchmark remarks that provide additional information about some MCLs, HHBPs, and HBSLs.
Source
Many of the water-quality benchmarks were accessed from the U.S. Geological Survey Health-Based Screening Levels database, accessed on April 4, 2023, from https://water.usgs.gov/water-resources/hbsl/. Benchmarks for total Trihalomethanes, Tritium, and Strontium-90 were provided by the U.S. Environmental Protection Agency (2015). Note that MCL benchmark values reported in millirem per year were substituted with a 50 picocuries per liter screening level.
References
U.S. Environmental Protection Agency, 2015, Protection of environment—Code of Federal Regulations 40, Part 141, Subpart G, National Primary Drinking Water Regulations, Maximum Contaminant Levels and Maximum Residual Disinfectant Levels: Washington, D.C., Office of the Federal Register, National Archives and Records Administration.
Examples
str(benchmarks)
Remove NULL List Elements
Description
Removes elements from a list that are equal to NULL
.
Usage
ccp(x)
Arguments
x |
'list'. |
Value
List
Author(s)
J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center
Examples
d <- list("a", "b", NULL, "c")
d
d <- ccp(d)
d
Check Package
Description
Check that a package is available.
Usage
check_package(pkg, msg = NULL, call. = FALSE)
Arguments
pkg |
'character' string. Package name. |
msg |
'character' string. Action package is used for. |
call. |
'logical' flag. Whether the function should be part of the error message. |
Value
Stops execution if the package is missing from the name space.
Author(s)
J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center
Examples
check_package(pkg = "inldata", msg = "Dataset access")
Cities and Towns
Description
Cities and towns (populated places) in the vicinity of Idaho National Laboratory, eastern Idaho.
Usage
cities
Format
A simple feature with fields:
name
City name.
id
Unique identifier.
geometry
Zero-dimensional geometry containing a single point.
Source
Spatial point extracts were obtained from the Master Address File / Topologically Integrated Geographic Encoding and Referencing (MAF/TIGER) Database (MTDB), 2023 data collection, released November 22, 2023. Which is a part of the U.S. Department of Commerce, U.S. Census Bureau, Geography Division/Cartographic Products Branch. The centroids of these extracts were cropped to the study area, and any non-essential data was removed.
Examples
print(cities)
Clean a Simple Feature
Description
Subset columns, transform coordinates, and (or) crop the spatial extent of a simple feature.
Usage
clean_sf(x, cols = NULL, agr = NULL, crs = NULL, extent = NULL, type = NULL)
Arguments
x |
'sf' object. Simple feature. |
cols |
'character' vector. Names indicating the columns to keep. Vector names are optional and used to rename columns. |
agr |
'character' vector.
Attribute geometry relationship,
specifies for each non-geometry attribute column how it relates to the geometry,
and can have one of following values: "constant", "aggregate", "identity".
Where "constant" is used for attributes that are constant throughout the geometry,
"aggregate" where the attribute is an aggregate value over the geometry,
"identity" when the attributes uniquely identifies the geometry of particular thing.
The default value assumes you don't know.
If named, vector names should correspond to the non-geometry list-column columns of |
crs |
'crs' object. Target coordinate reference system. |
extent |
'bbox' object. Spatial extent (aka bounding box) used to crop the simple feature. |
type |
'character' vector. For retured geometries of type "GEOMETRY" or "GEOMETRYCOLLECTION", the returned object will consist only of elements of the specified type, one of "POLYGON", "POINT", and "LINESTRING". |
Value
Returns an object of class 'sf'.
Author(s)
J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center
Combine Package Datasets
Description
Combine package datasets that can be coerced into a data frame into a single list.
Usage
combine_tables(package)
Arguments
package |
'character' string. Package name. |
Value
A list of dataset elements of class 'data.frame'. A list element is named using its dataset name.
Author(s)
J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center
County Boundaries
Description
County boundaries in the vicinity of Idaho National Laboratory, eastern Idaho.
Usage
counties
Format
A simple feature with fields:
name
County name.
id
Unique identifier.
geometry
Polygon geometry with a positive area (two-dimensional); sequence of points that form a closed, non-self-intersecting ring; the first ring denotes the exterior ring, zero or more subsequent rings denote holes in this exterior ring.
Source
Spatial polygon extracts were obtained from the Master Address File / Topologically Integrated Geographic Encoding and Referencing (MAF/TIGER) Database (MTDB), 2023 data collection, released November 22, 2023. Which is a part of the U.S. Department of Commerce, U.S. Census Bureau, Geography Division/Cartographic Products Branch. These polygons were cropped to study area, and any non-essential data was removed.
Examples
print(counties)
Coordinate Reference System
Description
Coordinate reference system (CRS) used by the U.S. Geological Survey Idaho National Laboratory Project Office. The CRS is based on the following attributes: Albers equal-area conic projection; latitude of first and second standard parallel is 42.83 and 44.16 decimal degrees, respectively; latitude and longitude of false origin is 41.5 and -113 decimal degrees, respectively; easting and northing of false origin is 200,000 and 0 meters, respectively; Clarke (1966) reference ellipsoid; North American Datum of 1983; and units of meters. The CRS is represented using an updated version of the well-known text (WKT2) strings.
Usage
crs
Format
A list with the following elements representing the CRS:
input
is the PROJ.4 string, and wkt
is the WKT2 strings.
Source
Idaho National Laboratory Project Office
Examples
print(crs)
Digital Elevation Model
Description
The digital elevation model (DEM) for the Idaho National Laboratory and its vicinity in eastern Idaho. A DEM is a representation of the land surface that uses a digital grid to describe the elevation values of the terrain.
Usage
dem
Format
A compressed SpatRaster
class object with layer:
elevation
Land-surface elevations in feet above the North American Vertical Datum of 1988 (NAVD 88).
Source
The National Map (TNM) 1/3-arc-second DEM (Gesch, 2007; Gesch and others, 2002), accessed on August 4, 2020. This dataset can be downloaded in a Esri ArcGRID TM format using TNM Download. Elevation datasets are distributed in geographic coordinates in units of decimal degrees, and in conformance with the NAD 83. Elevation values are in feet above the NAVD 88.
References
Gesch, D.B., 2007, The National Elevation Dataset, in Maune, D., ed., Digital Elevation Model Technologies and Applications—The DEM User's Manual, 2nd ed.: Bethesda, Maryland, American Society for Photogrammetry and Remote Sensing, p. 99–118.
Gesch, D., Oimoen, M., Greenlee, S., Nelson, C., Steuck, M., and Tyler, D., 2002, The National Elevation Dataset: Photogrammetric Engineering and Remote Sensing, v. 68, no. 1, p. 5–11.
See Also
make_shade
function for computing the hill shade from the DEM.
Examples
elevation <- terra::unwrap(dem)
print(elevation)
Laboratory Detection Limits
Description
Analytical method detection limits of selected radionuclides based on laboratory procedures.
Usage
dl
Format
A data frame with columns:
parm_nm
Long parameter name, such as "Strontium-90, water, unfiltered, picocuries per liter".
pcode
U.S. Geological Survey 5-digit parameter code used to identify the constituent measured, see
parameters
dataset for details. For example, the parameter code for Tritium is "07000".lab_det_lim_va
Laboratory detection limit concentration.
min_dt
Date that the detection limit went into effect.
reference
Source of detection limit. Reference citations are as follows: "Bartholomay and others (2003, table 9)", "Bartholomay and others (2014, table D1)", "Bartholomay and others (2021, table 4.1)", and "Bodnar and Percival (1982)"
Source
Idaho National Laboratory Project Office
References
Bartholomay, R.C., Knobel, L.L., and Rousseau, J.P., 2003, Field methods and quality-assurance plan for quality-of-water activities, U.S. Geological Survey, Idaho National Engineering and Environmental Laboratory, Idaho: U.S. Geological Survey Open-File Report 03–42 (DOE/ID–22182), 45 p. doi:10.3133/ofr0342.
Bartholomay, R.C., Maimer, N.V., and Wehnke, A.J., 2014, Field methods and quality-assurance plan for water-quality activities and water-level measurements, U.S. Geological Survey, Idaho National Laboratory, Idaho: U.S. Geological Survey Open-File Report 2014–1146 (DOE/ID–22230), 64 p. https://pubs.usgs.gov/of/2014/1146/.
Bartholomay, R.C., Maimer, N.V., Wehnke, A.J., and Helmuth, S.L., 2021, Field methods, quality-assurance, and data management plan for water-quality activities and water-level measurements, Idaho National Laboratory, Idaho: U.S. Geological Survey Open-File Report 2021–1004, 76 p., doi:10.3133/ofr20211004.
Bodnar, L.Z., and Percival, D.R., eds., 1982, Analytical Chemistry Branch procedures manual—Radiological and Environmental Sciences Laboratory: U.S. Department of Energy Report IDO–12096 [variously paged].
Examples
str(dl)
Download File from the Internet
Description
Download a file from the Internet and save to a cache directory.
Usage
download_file(url, cachedir = get_cache_dir(), ..., quiet = FALSE, mode = "wb")
Arguments
url |
'character' string. URL of a resource to be downloaded. |
cachedir |
'character' string.
Path to the cache directory, see |
... |
Additioanl arguments to be passed to the |
quiet |
'logical' flag. Whether to supress status messages (if any), and the progress bar. |
mode |
'character' string. Mode with which to write the file. Useful values are "w", "wb" (binary), "a" (append) and "ab". |
Value
Returns the path to the downloaded file, or extracted files when decompression occurs.
Author(s)
J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center
Eastern Snake River Plain Boundary
Description
Boundary of the eastern Snake River Plain (ESPR), Idaho. The ESPR is a structural basin that extends about 200 miles in a northeast direction and is 50-70 miles wide. The basin is bounded by faults on the northwest and by down warping and faulting on the southeast. It has been filled with basaltic lava flows interbedded with terrestrial sediments. The combination of basaltic rock and sedimentary deposits forms the ESRP aquifer, which is the primary source of groundwater in the basin
Usage
esrp
Format
A simple feature with fields:
geometry
Polygon geometry with a positive area (two-dimensional); sequence of points that form a closed, non-self-intersecting ring; the first ring denotes the exterior ring, zero or more subsequent rings denote holes in this exterior ring.
Source
The ESPR boundary was digitized from 7.5' quads within and in the vicinity of the Idaho National Laboratory by the U.S. Geological Survey Idaho National Laboratory Project Office The digitized polygons were made into shapefiles and converted into GeoJSON files.
Examples
print(esrp)
Extract Archive Contents
Description
Extract contents of an archive to a directory. Requires that the archive package is available.
Usage
extract_archive(file, destdir = tempdir())
Arguments
file |
'character' string. File path to the archive. |
destdir |
'character' string. Destination directory to extract files to. It will be created if necessary. Defaults to the temporary directory. |
Value
Invisibly returns the extracted path(s).
Author(s)
J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center
Examples
files <- system.file("extdata", "test.zip", package = "inldata") |>
extract_archive()
unlink(files)
Idaho National Laboratory Facilities
Description
Federal research facilities at the Idaho National Laboratory (INL). The INL facilities have been the primary source of radioactive and chemical waste constituents in the water from the eastern Snake River Plain aquifer and in perched groundwater zones at or near the INL. This is due to the wastewater disposal practices at the INL facilities.
Usage
facilities
Format
A simple feature with fields:
name
Facility name
.
id
Facility identifier. Facility abbreviations and descriptions are as follows: "TAN" Test Area North, "NRF" Naval Reactors Facility, "MRF" Materials and Fuels Complex, "ATRC" Advanced Test Reactor Complex, "INTEC" Idaho Nuclear Technology and Engineering Center, "CFA" Central Facilities Area "RWMC" Radioactive Waste Management Complex.
geometry
Set of polygons, where a polygon is a geometry with a positive area (two-dimensional).
Source
A GeoJSON file of the facilities was created by the U.S. Geological Survey Idaho National Laboratory Project Office
Examples
print(facilities)
Filter Data List Column
Description
Create a data list column filter for a React Table. Requires that the htmltools packages is available.
Usage
filter_data_list(table_id, style = "width: 100%; height: 28px;")
Arguments
table_id |
'character' string. Unique table identifier. |
style |
'character' string. CSS style applied to input HTML tag. |
Value
Returns a function to perform filtering.
Examples
f <- filter_data_list("table-id")
Manage Cache Directory
Description
Find, create, or clear the cache directory. Defaults to the temporary directory if the rappdirs package is unavailable. You can specify the path to the cache directory by setting an environment variable named "CACHE_DIR".
Usage
get_cache_dir(name = "inldata")
clear_cache_dir(name = "inldata")
Arguments
name |
'character' string. Name of cache directory. |
Value
Path to the cache directory.
Author(s)
J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center
Examples
dir <- get_cache_dir("test")
clear_cache_dir("test")
Extract File Extension
Description
Extract the extension of a file.
Usage
get_file_ext(x, compression = TRUE)
Arguments
x |
'character' vector. File path(s). |
compression |
'logical' flag. Whether to account for the compression extension '.gz', '.bz2' or '.xz'. |
Value
Returns the file (name) extensions (excluding the leading dot).
Author(s)
J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center
Examples
c("dir/file.txt", "file.txt.gz") |>
get_file_ext()
Extract File Size
Description
Extract size on the user's file system.
Usage
get_file_size(paths)
Arguments
paths |
'character' vector. File paths. |
Value
Formatted file size(s).
Author(s)
J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center
Examples
system.file("CITATION", package = "inldata") |>
get_file_size()
Groundwater Levels
Description
Groundwater levels in wells in the U.S. Geological Survey (USGS) water-level monitoring network, Idaho National Laboratory and vicinity, Idaho. The purpose of this network is to document the changes in storage and the general direction of groundwater flow within the eastern Snake River Plain (ESRP) aquifer. The data collected from this network have been used to determine changes in hydraulic-gradient that affect the rate and direction of groundwater and waste-constituent movement. It can also help identify sources of recharge and measure its effects. The groundwater measurements are taken from both the ESRP aquifer and the perched groundwater zones above the aquifer.
Usage
gwl
Format
A data frame with columns:
site_nm
Local site name.
site_no
USGS site number.
lev_dt
Date and time the water level was measured, in "America/Denver" time zone. Missing values of time were substituted with "12:00".
lev_meth_cd
Code indicating the method used to determine the water level. The codes and their meanings are as follows: "A" airline measurement, "B" analog or graphic recorder, "F" transducer, "G" pressure-gage measurement, "L" interpreted from geophysical logs, "O" observed, "S" steel-tape measurement, "T" electric-tape measurement, "V" calibrated electric tape—accuracy of instrument has been checked, "W" calibrated electric cable, and "Z" other.
lev_status_cd
Code indicating the status of the site at the time the water level was measured. The codes and their meanings are as follows: "1" static, "3" true value is above the reported water level value due to local conditions, "5" groundwater level affected by surface water, "P" site was being pumped.
lev_age_cd
Code indicating the water-level approval status. The codes and their meanings are as follows: "A" approved for publication—processing and review completed, and "P" provisional data subject to revision.
lev_va
Depth to water level, in feet below the land surface reference point.
sl_lev_va
Groundwater level above North American Vertical Datum of 1988 (NAVD 88), in feet.
lev_acy_va
Accuracy of depth to water-level measurement (
lev_va
), in feet.sl_lev_acy_va
Accuracy of groundwater level above NAVD value (
sl_lev_va
), in feet. Does not account for vertical datum shift.
Source
Data was obtained from the National Water Information System (NWIS) (U.S. Geological Survey, 2023). Groundwater level data was retrieved from NWIS by using the USGS R-package dataRetrieval (DeCicco and others, 2023). Data was retrieved for each site number listed in the samples dataset and removed any non-essential columns.
References
DeCicco, L.A., Hirsch, R.M., Lorenz, D., Watkins, W.D., Johnson, M., 2023, dataRetrieval: R packages for discovering and retrieving water data available from Federal hydrologic web services, v.2.7.13, doi:10.5066/P9X4L3GE.
U.S. Geological Survey, 2023, National Water Information System—web services, accessed April 7, 2023, from doi:10.5066/F7P55KJN.
Examples
str(gwl)
poi <- as.POSIXct(c("2000-01-01", "2001-01-01")) # period of interest
site_no <- "432700112470801" # well USGS 1
is <- gwl$lev_dt >= poi[1] & gwl$lev_dt < poi[2] & gwl$site_no == site_no
d <- gwl[is, ]
plotrix::plotCI(
x = d$lev_dt,
y = d$sl_lev_va,
li = d$sl_lev_va - d$sl_lev_acy_va,
ui = d$sl_lev_va + d$sl_lev_acy_va
)
State of Idaho Boundary
Description
A simplified representation of the boundary of Idaho, a state located in the northwestern region of the United States.
Usage
idaho
Format
A simple feature with fields:
geometry
Polygon geometry with a positive area (two-dimensional); sequence of points that form a closed, non-self-intersecting ring; the first ring denotes the exterior ring, zero or more subsequent rings denote holes in this exterior ring.
Source
Spatial extract was obtained from the Master Address File / Topologically Integrated Geographic Encoding and Referencing (MAF/TIGER) Database (MTDB), 2023 data collection, released November 22, 2023. Which is part of the U.S. Department of Commerce, U.S. Census Bureau, Geography Division/Cartographic Products Branch. The polygon's geospatial features were simplified by removing the vertices and any non-essential data was removed.
Examples
print(idaho)
Idaho National Laboratory Boundary
Description
Geographic limits of the Idaho National Laboratory (INL). The INL is located on the west-central part of the eastern Snake River Plain and covers an area of approximately 890 square miles. It was established in 1949 to develop atomic energy, nuclear safety, defense programs, environmental research, and advanced energy concepts.
Usage
inl
Format
A simple feature with fields:
geometry
Polygon geometry with a positive area (two-dimensional); sequence of points that form a closed, non-self-intersecting ring; the first ring denotes the exterior ring, zero or more subsequent rings denote holes in this exterior ring.
Source
The INL boundary was digitized from 7.5' quads within and in the vicinity of the Idaho National Laboratory by the U.S. Geological Survey Idaho National Laboratory Project Office The digitized polygons were made into shapefiles and converted into GeoJSON files.
Examples
print(inl)
Industrial Waste Ditch
Description
An industrial waste ditch located near the Naval Reactors Facility (NRF) in eastern Idaho. The NRF discharges its wastewater to this 1.65-mile-long waste ditch. The waste ditch was initially used in 1953 to dispose of non-radioactive, non-sewage industrial wastewater.
Usage
iwd
Format
A simple feature with fields:
geometry
Sequence of points connected by straight, non-self-intersecting line pieces, one-dimensional geometry.
Source
A GeoJSON file of the industrial waste ditch was created by the U.S. Geological Survey Idaho National Laboratory Project Office
Examples
print(iwd)
Lakes and Ponds
Description
Perennial lakes and ponds in the vicinity of the Idaho National Laboratory (INL) in eastern Idaho.
Usage
lakes
Format
A simple feature with fields:
gnis_nm
GNIS name.
id
Unique identifier.
reach_cd
Reach code, a unique 14-digit code that identifies a continuous piece of surface water with similar hydrologic characteristics.
gnis_id
Geographic Names Information System (GNIS) identifier.
feature_tp
USGS National Hydrography Dataset (NHD) feature type code. "LakePond" is a standing body of water with a predominantly natural shoreline surrounded by land; "Reservoir" is a constructed basin formed to contain water or other liquids; and "SwampMarsh" is a non-cultivated, vegetated area that is inundated or saturated for a significant part of the year.
geometry
Polygon geometry with a positive area (two-dimensional); sequence of points that form a closed, non-self-intersecting ring; the first ring denotes the exterior ring, zero or more subsequent rings denote holes in this exterior ring.
Source
Spatial polygon extract files obtained from the U.S. Geological Survey (USGS) National Hydrography Dataset (NHD) Medium Resolution for Idaho, released August 4, 2014. Which is part of the National Geospatial Technical Operations Center. These extracts were cropped to eastern Idaho extent and unnecessary columns were removed.
Examples
print(lakes)
Create Data Release
Description
Create U.S. Geological Survey (USGS) data release product from R-package datasets and their documentation. Requires that the xml2 and jsonlite packages are available.
Usage
make_data_release(
metadata,
package,
destdir = getwd(),
...,
bounding = NULL,
rngdates = NULL,
validate = FALSE
)
Arguments
metadata |
'character' string or named 'list'. Either the path to a JSON formatted metadata file that contains general information for the USGS data release (see Examples section), or a named list with the equivalent information. |
package |
'character' string. Name of a package. |
destdir |
'character' string. Destination directory to write files, with tilde-expansion performed. |
... |
Additional arguments to be passed to the |
bounding |
'bbox', 'sf', 'SpatRaster', or 'PackedSpatRaster' spatial feature.
Object to compute spatial bounding coordinates from, see |
rngdates |
'Date' or 'POSIXct' vector. Object to compute the date range of observations from. |
validate |
'logical' flag.
Whether to perform a metadata validation and stop execution if errors are found.
See |
Details
Citation entries for the R package (software release) and accompanying data release should be included in the package CITATION file, and documented in that order.
Value
Named list of metadata created for spatial and non-spatial datasets.
Author(s)
J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center
A.R. Trcka, U.S. Geological Survey, Idaho Water Science Center
See Also
parse_rd_db
function for reading and parsing R-package documentation.
Examples
destdir <- tempfile("")
rngdates <- c(samples$sample_dt, gwl$lev_dt) |> range()
l <- make_data_release(
metadata = system.file("extdata/metadata.json", package = "inldata"),
package = "inldata",
destdir = destdir,
include = "crs",
quiet = TRUE,
bounding = sites,
rngdates = rngdates
)
str(l, 1)
unlink(destdir, recursive = TRUE)
Create Package Datasets
Description
Create datasets for the inldata package and save each as an
R-data file with the .rda
extension, which is a format native to R.
The stats dataRetrieval, and stringi packages must be available.
This function is intended for use by inldata-package developers.
Usage
make_datasets(
path = getwd(),
destdir = file.path(path, "data"),
clean = FALSE,
tz = "America/Denver",
census_yr = 2023,
buffer_dist = 1000,
resolution = 100,
warn = 1,
timeout = 10,
compress = "xz",
seed = 0L,
quiet = FALSE
)
Arguments
path |
'character' string.
Path to the package's source directory, with tilde-expansion performed.
Defaults to the working directory.
Ensure that under the |
destdir |
'character' string.
Destination directory to write R-data files, with tilde-expansion performed.
Defaults to the |
clean |
'logical' flag. Whether to delete all pre-existing R-data files in the destination directory. |
tz |
'character' string.
Time zone specification.
Defaults to Mountain Standard Time (North America).
See |
census_yr |
'integer' number. United States census year. |
buffer_dist |
'numeric' number.
Buffer distance for the study area defined by the bounding of the sample |
resolution |
'numeric' number.
Spatial resolution of the raster grid, in meters.
Specify in units of the coordinate reference system ( |
warn |
'integer' value. Sets the handling of warning messages. Choose value of less than 0 to show no warnings, 1 to print warnings (default), and 2 to error on warnings. |
timeout |
'integer' number. Timeout for some of the internet operations, in minutes. Defaults to 10 minutes. |
compress |
'logical' flag or 'character' string.
Whether compression should be used when saving a dataset to file.
Character strings "auto", "gzip", "bzip2" and "xz" (default) are accepted.
See the |
seed |
'integer' count. Random number generator state, used to create reproducible results. |
quiet |
'logical' flag. Whether to suppress printing of debugging information. |
Details
This function retrieves and parses datasets from local and remote sources. Access to the internet is required to download data from the following remote sources:
National Elevation Dataset (NED) on Amazon's Cloud.
Spatial data from the TIGER/Line Geodatabase that contains spatial extracts from the U.S. Census Bureau's MAF/TIGER database.
National Hydrography Dataset (NHD) data from the USGS NHD file geodatabase on Amazon's Cloud.
Each of the package dataset's represents a snapshot of the data at a specified point in time.
While geospatial datasets may change very little over time
(such as the boundary of the Idaho National Laboratory),
other datasets continue to grow as new data becomes available
(such as water-quality data measured in samples
collected from wells).
To ensure that the function retrieves the most recent data versions, it is recommended to periodically check the URLs of remote sources and update them within the function. It is also advisable to document any changes in the datasets and update their help documentation accordingly.
Files downloaded during intermediate stages of the build process
are cached on your computer to speed up future builds.
You can specify the path to the cache directory by setting an environment variable named CACHE_DIR
.
By default the location of the cache directory is determined by the get_cache_dir()
command.
Value
Returns the paths to the newly created R Data files invisibly.
Author(s)
J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center
Examples
# Example requires that the 'path' argument be specified as
# the top-level directory of the inldata package repository.
## Not run:
make_datasets(destdir = tempfile(""))
## End(Not run)
Create Data Model
Description
Create a data model object from inldata package datasets. A data model holds a list of tables and their relationships. Requires that the dm package is available.
Usage
make_dm()
Value
Invisibly returns the data model, an object of class dm
.
Author(s)
J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center
See Also
make_erd
function for creating an entity-relationship diagram.
Create Entity Relationship Diagram
Description
Create an Entity-Relationship Diagram (ERD) from a data model and save it to disk in SVG format. Requires that the dm, DiagrammeR, V8, and DiagrammeRsvg packages are available.
Usage
make_erd(dm, path = tempfile(fileext = ".svg"), overwrite = FALSE)
Arguments
dm |
'dm' object. Data model. |
path |
'character' string. File path to write the ERD. |
overwrite |
'logical' flag. Whether to overwrite an existing file. |
Value
Invisibly returns the file path.
Author(s)
J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center
See Also
make_dm
function for creating a data model for the inldata package.
Compute Hill Shade
Description
Compute hill shade from a digital elevation model. A hill shade layer is often used as a backdrop on top of which another, semi-transparent, layer is drawn.
Usage
make_shade(
x,
scale = 2,
neighbors = 8,
angle = 40,
direction = 270,
normalize = TRUE
)
Arguments
x |
'SpatRaster' object.
Spatial raster of land-surface elevations, such as the |
scale |
'numeric' number. Scaling factor used to convert the elevation values. The default value is 2. |
neighbors |
'numeric' count. Number of neighboring cells to use to compute slope or aspect with. Either 8 (queen case) or 4 (rook case). |
angle |
'numeric' number. The sun's angle of elevation above the horizon, ranges from 0 to 90 degrees. A value of 0 degrees indicates that the sun is on the horizon. A value of 90 degrees indicates that the sun is directly overhead. Default is a 40 degree angle. |
direction |
'numeric' number. Direction (azimuth) angle of the light source (sun), in degrees. An direction of 0 degrees indicates north, east is 90 degrees, south is 180 degrees, and west is 270 degrees (default). |
normalize |
'logical' flag. Whether to set values below zero to zero and results normalized between 0 and 1. |
Value
Spatial raster of hill shade values.
Author(s)
J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center
Examples
elevation <- terra::unwrap(dem)
hillshade <- make_shade(elevation)
terra::plot(hillshade,
col = inlcolor::get_colors(
n = 256,
scheme = "grayC"
),
mar = c(2, 2, 1, 4),
legend = FALSE
)
terra::plot(elevation,
col = inlcolor::get_colors(
n = 256,
scheme = "dem2",
alpha = 0.7,
bias = 0.9
),
add = TRUE
)
Mountain Ranges and Buttes
Description
A simplified representation of mountain ranges and buttes in the vicinity of Idaho National Laboratory (INL) in eastern Idaho.
Usage
mountains
Format
A simple feature with fields:
name
Feature name.
geometry
Polygon geometry with a positive area (two-dimensional); sequence of points that form a closed, non-self-intersecting ring; the first ring denotes the exterior ring, zero or more subsequent rings denote holes in this exterior ring.
Source
Spatial polygons were created from areas in the digital elevation model (DEM) where terrain slope is greater than a specified threshold.
Examples
print(mountains)
Parameter Information
Description
Parameter information for selected chemical constituents, organic compounds, and radionuclides measured for in water samples collected from monitoring sites in the U.S. Geological Survey (USGS) water-quality monitoring network, Idaho National Laboratory and vicinity, Idaho.
Usage
parameters
Format
A data frame with columns:
pcode
USGS 5-digit parameter code.
parm_group_nm
Parameter group name. Abbreviations and descriptions are as follows: "Information" includes information about the water sample such as the date and time of collection, the location of the sample, and the method of analysis used; "Inorganics, Major, Metals" includes major inorganic ions and metals, "Inorganics, Major, Non-metals" includes major inorganic non-metallic ions; "Inorganics, Minor, Metals" includes minor inorganic metallic ions; "Inorganics, Minor, Non-metals" includes minor inorganic non-metallic ions; "Nutrient" includes nutrients such as nitrogen and phosphorus that can be present in water samples; "Organics, Other" includes organic compounds that are not classified as pesticides or PCBs; "Organics, Pesticide" includes organic compounds that are used as pesticides, such as insecticides, herbicides, and fungicides; "Physical" includes physical characteristics of water; "Radiochemical" includes radioactive isotopes that can be present in water samples; and "Stable Isotopes" includes non-radioactive isotopes of elements that can be used to trace the movement of water through the hydrologic cycle.
parm_nm
Long parameter name, such as "Strontium-90, water, unfiltered, picocuries per liter".
casrn
Chemical Abstracts Service (CAS) registry number, such as "10098-97-2" for Strontium-90.
srsname
Substance Registry Services (SRS) name, such as "Strontium-90".
unit_cd
Units of measurement, see
units
dataset for unit descriptions.min_dt
Collection date of first sample analyzed for the parameter.
max_dt
Collection date of last sample analyzed for the parameter.
nrecords
Number of records associated with the parameter.
nsites
Number of sampling sites where the parameter was observed.
Source
USGS water data acquired from the National Water Information System (U.S. Geological Survey, 2023).
The SRS name (srsname
)
for "Trihalomethanes (four), total, from SDWA NPDWR" was shorten to its preferred acronym "TTHM4".
References
U.S. Geological Survey, 2023, National Water Information System—web services, accessed April 7, 2023 from doi:10.5066/F7P55KJN.
Examples
str(parameters)
Parse R-Package Dataset Documentation
Description
Reads and parses R documentation (Rd) files.
Usage
parse_rd_db(..., doc_type = "data")
Arguments
... |
Arguments to be passed to the |
doc_type |
'character' vector.
Document type, such as |
Value
A named list containing the documentation sections as character strings.
Author(s)
J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center
Examples
l <- parse_rd_db(package = "inldata")
str(l, 1)
Parse Station Names
Description
Convert station names to common site names.
Usage
parse_station_nm(x)
Arguments
x |
'character' vector.
Station names, such as |
Value
A vector of common site names parsed from x
.
Author(s)
J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center
Examples
x <- c(
"02N 30E 08DAD1 BADGING FACILITY",
"03N 29E 33CCC1 MIDDLE 2051 PORT6 ZONE6 826.8FT",
"MUD LAKE NR TERRETON ID"
)
parse_station_nm(x)
Concatenate Character Vectors
Description
Concatenate character vectors and omit empty strings.
Usage
paste_strings(..., collapse = " ", recycle0 = FALSE)
Arguments
... |
'character' vectors (or objects coercible to character vectors). Corresponding elements are to be concatenated. |
collapse |
'character' string. Seperates the results. |
recycle0 |
'logical' flag.
Whether a zero-length character argument should lead to a
zero-length character ( |
Value
Returns a character vector.
Author(s)
J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center
Examples
paste_strings(letters, c(), c(1, 2, 3))
paste_strings(letters, c(), c(1, 2, 3), recycle0 = TRUE)
Percolation Ponds
Description
Percolation ponds in the vicinity of Idaho National Laboratory (INL), eastern Idaho. Wastewater from facilities at the INL has been and is currently disposed of in percolation (infiltration), evaporation (lined and unlined), and infiltration ponds.
Usage
percponds
Format
A simple feature with fields:
name
Name of the percolation ponds.
facility_id
INL facility the percolation pond is located at. Abbreviations and descriptions are as follows: "ATRC" is the Advanced Test Reactor Complex, "CFA" is the Central Facilites Area, "INTEC" is the Idaho Nuclear Technology and Engineering Center, "MFC" is the Materials and Fuels Complex, "NRF" is the Nuclear Reactors Facility, "RWMC" is the Radoiactive WAste Management Complex, and "TAN" is the Test Area North facility.
min_dt
Approximate year when the percolation pond was activated, with missing values indicating that the information is not available.
max_dt
Approximate year when the percolation pond was decommissioned, with missing values indicating that the pond is still in operation.
geometry
Polygon geometry with a positive area (two-dimensional); sequence of points that form a closed, non-self-intersecting ring; the first ring denotes the exterior ring, zero or more subsequent rings denote holes in this exterior ring.
Source
U.S. Geological Survey Idaho National Laboratory Project Office. Polygons representing percolation ponds were digitized from historical Google Earth imagery, dating as far back as 1985.
Examples
print(percponds)
Read USGS RDB file
Description
Reads a RDB (Relational Database) file in table format and creates a data frame from it. The USGS (U.S. Geological Survey) RDB file is a variant of a tab-delimited ASCII file structure.
Usage
read_rdb(file, na_strings = "")
Arguments
file |
'character' string. Path to file which the data are to be read from. |
na_strings |
'character' vector.
Strings which are interpreted as |
Value
A data frame containing a representation of the data in the file.
Author(s)
J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center
Examples
file <- system.file("extdata", "test.rdb", package = "inldata")
d <- read_rdb(file)
str(d)
Road Network
Description
Road network in the vicinity of Idaho National Laboratory, eastern Idaho.
Usage
roads
Format
A simple feature with fields:
name
Street or road name.
id
Unique identifier.
prisec_fl
Whether a road is classified as primary or secondary.
geometry
Sequence of points connected by straight, non-self-intersecting line pieces, one-dimensional geometry.
Source
Spatial line extracts were obtained from the Master Address File / Topologically Integrated Geographic Encoding and Referencing (MAF/TIGER) Database (MTDB), 2023 data collection, released November 22, 2023. Which is a part of the U.S. Department of Commerce, U.S. Census Bureau, Geography Division/Cartographic Products Branch. These lines were cropped to the study area, and any non-essential data was removed.
Examples
print(roads)
Round Numbers
Description
Rounds the values in its first argument to the specified number of decimal places. This function uses the U.S. Geological Survey rounding method.
Usage
round_numbers(x, digits = 0)
Arguments
x |
'numeric' vector. Value to be rounded. |
digits |
'integer' vector or value.
Number of decimal places to use (default 0).
Values are recycled to match the vector length of |
Value
A numeric vector of rounded values.
Author(s)
J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center
Examples
round_numbers(x = rep(pi, 3), digits = c(1, 2, 3))
Discrete Sample Data
Description
Water-quality information for both groundwater and surface water collected from monitoring stations in and around the Idaho National Laboratory, Idaho. The water samples were collected in the field and analyzed in a laboratory to obtain water-quality data. The dataset was obtained from the National Water Information System (NWIS), which is maintained by the U.S. Geological Survey. The NWIS is a comprehensive and distributed application that supports the acquisition, processing, and long-term storage of water data.
Usage
samples
Format
A data frame with columns:
site_nm
Local site name.
sample_dt
Date and time the sample was collected, in "America/Denver" time zone. Missing values of time were substituted with "12:00".
parm_short_nm
Parameter short name assigned by the USGS, such as "pH".
unit_cd
Units of measurement, see
units
dataset for unit descriptions.remark_cd
Remark code (result level) used to qualify the parameter value. The codes and their meanings are as follows: NA (missing value) is a quantified value; "<" is where the actual value is known to be less than the value reported, that is, the measured concentration is below the reporting limit (RL) and represented as a censored (or nondetection) value. For censored values, the value reported is the RL; "E" is an estimated value, that is, the actual value is greater than the minimum detection limit (MDL) and less than the laboratory reporting level (LRL); "R" is a nondetect, result less than sample-specific critical level; and "U" is a material specifically analyzed for but not detected.
result_va
Parameter value.
lab_sd_va
Laboratory standard deviation (SD). For radiochemical data, SD is typically determined from the counting error. Prior to January 1, 2008, counting error was reported as two SD (Bartholomay and others, 2020, p. 27), therefore, these values were divided by 2.
lab_li_va
Lower confidence interval of the
result
value based on laboratory analysis.lab_ui_va
Upper confidence interval of the
result
value based on laboratory analysis. In cases where the upper and lower limits are identical, the parameter is expressed as an exact value.rpt_lev_va
Laboratory reporting limit in effect for the parameter and analytical method at the time the measurement was made.
rpt_lev_cd
Reporting level code that identifies the analytical reporting level appropriate for the analytical method. The codes and their meanings are as follows: "DLBLK" detection limit by blank data; "DLDQC" detection limit by DQCALC, lowest concentration that with 90 percent confidence will be exceeded no more than 1 percent of the time when a blank sample is measured; "IRL" interim reporting level, a temporary reporting level; "LRL" laboratory reporting level, equal to twice the yearly-determined LT-MDL; "LT-MDL" long-term method detection limit, a detection level derived by determining the standard deviation of a minimum of 24 MDL spike sample measurements over an extended period of time; "MDL" method detection limit, minimum concentration of a substance that can be measured and reported with a 99 percent confidence that the analyte concentration is greater than zero; "PQL" practical quantitation limits; "MRL" minimum reporting level, smallest measured concentration that can be reliably measured using a given analytical method; "RLDQC" reporting limit by DQCALC, is greater than or equal to two times the DLDQC; "SSLC" sample-specific critical level, the calculated and reported value is below which the radiochemistry result is considered a non-detect; and "SSMDC" sample-specific minimum detectable concentration, a reporting level that varies for each sample and is primarily used in radiochemical analyses.
medium_cd
Medium code that identifies the material type and quality assurance type of the sample. The codes and their meanings are as follows: "OAQ" is a blank sample collected for QC purposes; "WG" is water below land surface contained in the saturated zone (groundwater); "WGQ" is a groundwater quality-control (QC) sample; "WS" is water on the surface of the Earth (surface water); and "WSQ" surface water QC sample.
anl_ent_cd
Analyzing entity code of the organizational unit that performed the sample analysis used to obtain the result.
dqi_cd
Data quality indicator code that indicates the review status of a result. The codes and their meanings are as follows: "A" historical data, "R" reviewed and accepted, and "S" provisional (presumed satisfactory).
meth_cd
Method code, the codes are documented in the NWIS Method Code Dictionary.
sample_type_cd
Sample type code that identifies the quality-assurance (QA) type of a sample. The codes and their meanings are as follows: "2" is a blank sample; "6" is a reference material sample; "7" is a replicate sample taken from the environment; "9" is a regular sample taken from the environment; "B" is a unspecified QA sample; and "H" is a composite (time) sample.
db_no
2-digit NWIS database number. The codes and their meanings are as follows: "01" is the environmental database, and "10" is the QA database.
sample_id
Unique identifier for the water sample. The sample code is a concatenation of the site number, medium code, and date-time the sample was collected.
site_no
USGS site identification number.
pcode
USGS 5-digit parameter code. For example, the parameter code for Tritium is "07000".
rep_pair_id
Unique identifier used for matching pairs of replicate samples for a specific parameter. Replicate pairs are identified by matching a replicate sample (
sample_type_cd
equal to 7) with its corresponding regular environmental sample (sample_type_cd
equal to 9).result_tx
Remark about the water quality result
remark
Remarks pertaining to changes applied after the records were obtained from NWIS.
anl_dt
Result analysis date.
Source
Data were obtained from the NWIS-QWDATA database on January 22, 2024, in tab-delimited output-format using the QWDATA system (U.S. Geological Survey, 2024). The following steps were taken to process the data:
-
Column Name Translation: Column names were switched from NWIS alpha codes to NWIS parameter codes.
-
Class Conversion: Classes for each column were converted to the appropriate type (numeric, POSIX, factor).
-
Column Removal: Unnecessary columns were removed.
-
Duplicate Removal: Duplicate records in the NWIS and QWDATA databases were removed.
-
Data Cleaning: Corrupted results were removed. A column was added for data processing remarks. Zero and negative results were reported as nondetects.
-
Radiochemical Parameter Identification: Radiochemical parameter codes were identified. Nondetects were reported as less than the reporting level.
-
Sample Type Reporting: In the absence of a sample type code, results were classified as environmental samples. Data from blank, spiked, and reference samples, as well as composite samples (collected over a period of time), were excluded.
-
Sample Identifier Creation: Site number and date/time were combined to create a unique sample identifier.
-
Error Conversion: Counting error was converted to laboratory standard deviation. Data entered into NWIS with an uncertainty of twice the standard deviation (data entered before 2008), were converted to one standard deviation.
-
Record Removal: Records associated with counting error parameter codes were removed.
-
Replicate Pairing: Replicate samples were paired based on the parameter code, site number, and time difference between sample collection.
-
Data Adjustment: The detection limit, left-censored values, and non-positive lower limit were accounted for. Interval censored data were represented using upper and lower limits of the 95-percent confidence interval of the parameter value.
References
Bartholomay, R.C., Maimer, N.V., Rattray, G.W., and Fisher, J.C., 2020, An update of hydrologic conditions and distribution of selected constituents in water, Eastern Snake River Plain Aquifer and perched groundwater zones, Idaho National Laboratory, Idaho, emphasis 2016-18: U.S. Geological Survey Scientific Investigations Report 2019-5149 (DOE/ID-22251), 82 p., doi:10.3133/sir20195149.
U.S. Geological Survey, 2024, National Water Information System—Water-Quality System (QWDATA) data retrieval program.
Examples
str(samples)
poi <- as.POSIXct(c("1989-01-01", "2019-01-01")) # period of interest
is_poi <- samples$sample_dt >= poi[1] & samples$sample_dt < poi[2]
is_stc <- samples$sample_type_cd %in% c("7", "9")
site_no <- "433253112545901" # well USGS 20
pcode <- "07000" # tritium, water, unfiltered, picocuries per liter
is <- is_poi & is_stc & samples$site_no == site_no & samples$pcode == pcode
d <- samples[is, ]
plotrix::plotCI(
x = d$sample_dt,
y = d$result_va,
li = d$lab_li_va,
ui = d$lab_ui_va
)
site_no <- "433322112564301" # well USGS 38
pcode <- "01030" # chromium, water, filtered, micrograms per liter
is <- is_poi & is_stc & samples$site_no == site_no & samples$pcode == pcode
d <- samples[is, ]
plotrix::plotCI(
x = d$sample_dt,
y = d$result_va,
li = d$lab_li_va,
ui = d$lab_ui_va
)
Site Information
Description
Information for sites in the U.S. Geological Survey (USGS) monitoring networks, Idaho National Laboratory (INL) and vicinity, Idaho. The monitoring networks at the INL have evolved to their current 2024 schedules of monitoring because groundwater and surface-water sites were installed for various reasons; for example, the need to estimate the volume of the eastern Snake River Plain aquifer, or to document and understand changes in water quality. The USGS compiled the list of sites monitored by the USGS using publications by Knobel and others (2005, table 1) and Bartholomay (2022, table 1). One well site (site no. 425812113271201) was omitted from the dataset because its geographical location falls outside the designated study area.
Usage
sites
Format
A simple feature with fields:
site_nm
Local site name.
station_nm
USGS station name with all extra spaces removed from text. Extra spaces include leading, trailing and in-between spaces except for a single space character between words.
site_no
USGS site identification number.
coord_meth_cd
Latitude/longitude coordinate method code. The codes and their meanings are as follows: "C" is surveyed; "D" is a differentially corrected Global Positioning System (GPS); "G" mapping grade GPS unit (handheld accuracy range 3.7 to 12.2 meters); "L" long range navigation system; "M" interpolated from topographic map; "N" is not surveyed; "S" is a transit, theodolite, or other surveying method; and "X" is not applicable.
coord_acy_va
Accuracy of latitude/longitude value in seconds.
alt_va
Elevation of the land surface reference point, in feet above the North American Vertical Datum of 1988 (NAVD 88).
alt_meth_cd
Method code for measuring elevation. The codes and their meanings are as follows: "D" is a differentially corrected global positioning system, "L" is a level or other surveyed method, and "M" is interpolated from a topographic map; "N" is interpolated from a Digital Elevation Model; "X" is a GNSS2 - Level 2 Quality Survey Grade Global Navigation Satellite System; and "Y" is a GNSS3 - Level 3 Quality Survey Grade Global Navigation Satellite System.
alt_acy_va
Accuracy of the elevation value (
alt_va
), in feet. Does not account for vertical datum shift.construction_dt
Date the well was completed.
huc_cd
Hydrologic unit code (HUC). Hydrologic units are geographic areas representing part or all of a surface drainage basin or distinct hydrologic feature and are delineated on the Hydrologic Unit Map. The codes and their meanings are as follows: "17040201" is the Idaho Falls watershed; "17040206" is the Portneuf River; "17040209" is the Blackfoot River; "17040214" is Beaver-Camas; "17040215" is the Medicine Lodge Creek; "17040216" is the Big Lost River; "17040217" is the Little Lost River; and "17040218" is Birch Creek.
reliability_cd
Reliability code for data available for the site. The codes and their meanings are as follows: "C" is data that have been checked by the reporting agency; "M" is minimal data; and "U" is unchecked data.
nat_aqfr_cd
National aquifer code where "N600SKRVPB" is the Snake River Plain basin-fill aquifers, and "N600SKRVPV" is the Snake River Plain basaltic-rock aquifers.
aqfr_cd
Aquifer code defined by the catalog of aquifer names and geologic unit codes used by the Water Mission Area. The codes and their meanings are as follows: "100CNZC" is the Cenozoic Erathem, and "110SKRV" is the Snake River Group.
aqfr_type_cd
Aquifer type code. The codes and their meanings are as follows: "C" is a confined single aquifer, "M" is confined multiple aquifers, "U" is an unconfined single aquifer, and "X" is mixed (confined and unconfined) multiple aquifers.
well_depth_va
Depth of the finished well, in feet below the land surface datum.
hole_depth_va
Total depth of the borehole, in feet below the land surface datum.
depth_src_cd
Source code for depth measurements. The codes and their meanings are as follows: "A" is reported by another government agency, "D" is from driller's log or report, "G" is reported by a private geologist-consultant or university associate, "L" is interpreted from geophysical logs by personnel of source agency, "O" is reported by owner of well, "R" is reported by person other than the owner, driller, or another government agency, "S" is measured by personnel of reporting agency; and "Z" is other source.
completion_cd
Borehole completion code. The codes and their meanings are as follows: "M" is a multilevel completion, "O" is an open hole completion, and "P" is an open hole completion prior to multilevel completion.
network_cd
Monitoring network code. The codes and their meanings are as follows: "A" is the aquifer-monitoring network, "P" is the perched-groundwater monitoring network, "S" is the surface-water monitoring network.
pos
Position specifier for site-labels on a map. Values of 1, 2, 3 and 4, respectively indicate positions below (south), to the left (west) of, above (north), and to the right (east) of the site coordinates.
min_dt
Date of first record.
max_dt
Date of last record.
nmeas
Number of measurments recorded at the site includes either groundwater-level or streamflow measurements.
nsamples
Number of water-quality samples collected from the site.
nreps
Number of replicate samples collected from the site.
geometry
Zero-dimensional geometry containing a single point.
Source
USGS site data acquired from the NWIS (U.S. Geological Survey, 2023).
The station name (station_nm
) for the data was parsed for a more readable name.
A borehole completion code (completion_cd
),
as well as an aquifer monitoring network code (network_cd
) were created.
A position specifier for site-labels on a map (pos
) was also created.
The classes of the columns were specified, and any unnecessary columns were removed.
References
Bartholomay, R.C., 2022, Historical development of the U.S. Geological Survey hydrological monitoring and investigative programs at the Idaho National Laboratory, Idaho, 2002-2020: U.S. Geological Survey Open-File Report 2022-1027 (DOE/ID-22256), 54 p., doi:10.3133/ofr20221027.
Knobel, L.L., Bartholomay, R.C., and Rousseau, J.P., 2005, Historical development of the U.S. Geological Survey hydrologic monitoring and investigative programs at the Idaho National Engineering and Environmental Laboratory, Idaho, 1949 to 2001: U.S. Geological Survey Open-File Report 2005-1223 (DOE/ID-22195), 93 p., doi:10.3133/ofr20051223.
U.S. Geological Survey, 2023, National Water Information System—web services, accessed April 7, 2023, from doi:10.5066/F7P55KJN.
Examples
print(sites)
Rivers and Streams
Description
Stream segments in the vicinity of Idaho National Laboratory (INL), eastern Idaho. Surface water infiltrated to the eastern Snake River Plain aquifer through river and streams.
Usage
streams
Format
A simple feature with fields:
gnis_nm
GNIS name.
id
Unique identifier.
reach_cd
Reach code, a unique 14-digit code that identifies a continuous piece of surface water with similar hydrologic characteristics.
gnis_id
Geographic Names Information System (GNIS) identifier.
feature_tp
USGS National Hydrography Dataset (NHD) feature type code. The codes and their meanings are as follows: "ArtificialPath" is a surrogate for general flow direction; "CanalDitch" is an artificial open waterway constructed to transport water, to irrigate or drain land, to connect two or more bodies of water, or to serve as a waterway for watercraft; "Connector"is a linear water feature that connects two or more waterbodies or other linear water features; and "StreamRiver" is a linear water feature that is a natural or man-made flowing body of water.
geometry
Sequence of points connected by straight, non-self-intersecting line pieces, one-dimensional geometry.
Source
Spatial line extract files obtained from the U.S. Geological Survey (USGS) National Hydrography Dataset (NHD) Medium Resolution for Idaho, released August 4, 2014. Which is part of the National Geospatial Technical Operations Center. These extracts were cropped to eastern Idaho extent and unnecessary columns were removed.
Examples
print(streams)
Surface-Water Measurements
Description
Stage measurements and calculated discharge at gauging stations in the U.S. Geological Survey (USGS) surface-water monitoring network, Idaho National Laboratory and vicinity, Idaho. The purpose of this network is to provide information on the availability and distribution of surface water resources.
Usage
swm
Format
A data frame with columns:
site_nm
Local site name.
site_no
USGS site number.
stage_dt
Date and time the water level was measured, in "America/Denver" time zone. Missing values of time were substituted with "12:00".
stage_va
Gage height (stage) as shown on the inside staff gage at the site or read off the recorder inside the gage house in feet.
disch_va
Computed discharge in cubic feet per second (cfs).
stage_acy_va
Accuracy of stage measurment in feet.
disch_acy_va
Accuracy of computed discharge in cfs.
Source
Data was obtained from the National Water Information System (NWIS) (U.S. Geological Survey, 2023). Groundwater level data was retrieved from NWIS by using the USGS R-package dataRetrieval (DeCicco and others, 2023). Data was retrieved for each site number listed in the samples dataset and removed any non-essential columns.
References
DeCicco, L.A., Hirsch, R.M., Lorenz, D., Watkins, W.D., Johnson, M., 2023, dataRetrieval: R packages for discovering and retrieving water data available from Federal hydrologic web services, v.2.7.13, doi:10.5066/P9X4L3GE.
U.S. Geological Survey, 2023, National Water Information System—web services, accessed January 10, 2024, from doi:10.5066/F7P55KJN.
Examples
str(swm)
poi <- as.POSIXct(c("2000-01-01", "2024-01-01")) # period of interest
site_no <- "13132500" # station BIG LOST RIVER NR ARCO ID
is <- swm$stage_dt >= poi[1] & swm$stage_dt < poi[2] & swm$site_no == site_no
d <- swm[is, ]
plotrix::plotCI(
x = d$stage_dt,
y = d$stage_va,
li = d$stage_va - d$stage_acy_va,
ui = d$stage_va + d$stage_acy_va
)
Test Location is Package Directory
Description
Test whether the working directory is located at the top level directory of the package.
Usage
test_pkg_dir(pkg)
Arguments
pkg |
'character' string. Package name. |
Value
Formatted file size(s).
Author(s)
J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center
Examples
test_pkg_dir("inldata")
Trim Station Names
Description
Convert station names to common site names.
Usage
trim_station_nm(x)
Arguments
x |
'character' vector.
Station names, such as |
Value
A vector of common site names parsed from x
.
Author(s)
J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center
Examples
x <- c(
"03N 29E 12DDB1 FIRE STA 2",
"03N 29E 24CCA1 MIDDLE 2050A PORT15 ZONE15 516.8FT"
)
trim_station_nm(x)
Units of Measurement
Description
Descriptive information about the measurement units.
Usage
units
Format
A data frame with columns:
unit_cd
Measurment abbreviation for units.
unit_ds
Description for units of measurement.
siunitx
Units formatted for LaTeX using the siunitx package notation.
Source
Idaho National Laboratory Project Office
Examples
str(units)
Validate Metadata
Description
Validates the Extensible Markup Language (XML) formatted metadata
that is intended for a USGS data release.
Checks your FGDC-compatible geospatial metadata record using
mp (metadata parser).
Requires the mp
executable is on your path.
Download and install the software if not found.
Usage
validate_metadata(file, destdir = NULL, opts = c("e", "h", "f"), error = FALSE)
Arguments
file |
'character' string. Path to a XML formatted metadata file that contains the information for a USGS data release. |
destdir |
'character' string.
Destination directory to write files, with tilde-expansion performed.
Defaults to the |
opts |
'character' vector.
Output option codes.
Choose from one or more of the following codes:
|
error |
'logical' flag.
Whether to stop execution if validation errors are found (default is |
Value
Invisibly returns a flag indicating whether validation errors were found.
Returns NA
if mp executable is not accessible.
Author(s)
J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center
See Also
make_data_release
function for creating a USGS data release.
Examples
validate_metadata(
file = system.file("extdata/test.xml", package = "inldata"),
destdir = "validate"
)
list.files("validate")
unlink("validate", recursive = TRUE)
Write Package Datasets
Description
Exports the content of package datasets into non-proprietary, open,
and well-documented standard file formats, enhancing their accessibility for future use.
It supports multiple formats:
CSV,
JSON (requires jsonlite
package),
Arrow Parquet (requires arrow
package),
Excel XLMS (requires writexl
package),
GeoJSON,
Shapefile, and
GeoTIFF.
Usage
write_datasets(
package,
destdir = getwd(),
formats = NULL,
gzip = NULL,
overwrite = TRUE,
include = NULL,
exclude = NULL,
pretty = TRUE,
quiet = FALSE
)
Arguments
package |
'character' string. Name of a package. |
destdir |
'character' string. Destination directory to write files, with tilde-expansion performed. |
formats |
'character' vector.
Formats for saving datasets.
Choose from one or more of the following formats:
|
gzip |
'character' vector.
File |
overwrite |
'logical' flag. Whether to overwrite an existing file. |
include |
'character' vector. Names(s) of datasets to include. By default, a file is created for each package dataset. |
exclude |
'character' vector. Name(s) of datasets to exclude. By default, none are excluded. |
pretty |
'logical' flag.
Whether to add indentation, whitespace, and newlines to JSON output (default is |
quiet |
'logical' flag. Whether to suppress printing of debugging information. |
Details
Different types of datasets are written to various file formats.
For instance, a dataset in the form of a data table (data.frame
class) is exported to
a CSV (csv
), JSON (json
), Parquet (parquet
), and Spreadsheet (xlsx
) file.
A dataset representing simple features (sf
or sfc
class) is exported to
a GeoJSON (geojson
) and Shapefile (shp
) file.
A spatial-raster dataset (SpatRaster
or PackedSpatRaster
class) is exported to
a GeoTIFF (tiff
) file.
Lastly, a coordinate reference system (crs
class) is exported to a text (txt
) file.
Value
Invisibly returns the output file path(s).
Author(s)
J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center
Examples
dir <- tempfile("")
write_datasets(
package = "inldata",
destdir = dir,
formats = c("txt", "csv", "json", "geojson"),
include = c("crs", "dl", "inl"),
pretty = FALSE,
quiet = TRUE
)
unlink(dir, recursive = TRUE)
Write Lines to a File
Description
Write text lines to a file.
Usage
write_lines(text, path, gz = FALSE)
Arguments
text |
'character' vector. Text to write to file. |
path |
'character' string. Path to the file. |
gz |
'logical' flag.
Whether to compress the file using Gzip.
The |
Value
Invisibly returns the extracted path(s).
Author(s)
J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center
Examples
path <- write_lines(
text = "Test",
path = tempfile(fileext = ".txt"),
gz = TRUE
)
unlink(path)