
Get USGS Parameter Code Information
Source:R/read_waterdata_parameter_codes.R
read_waterdata_parameter_codes.Rd
Parameter codes are 5-digit codes and associated descriptions used to identify the constituent measured and the units of measure. Some parameter code definitions include information about the sampling matrix, fraction, and methods used to measure the constituent. Some parameters are fixed-value (fxd) numeric codes having textual meaning (for example: parameter code 00041 is a weather code parameter, code of 60 means rain), but more commonly represent a numeric value for chemical, physical, or biological data.
Usage
read_waterdata_parameter_codes(
parameter_code = NA_character_,
parameter_name = NA_character_,
unit_of_measure = NA_character_,
parameter_group_code = NA_character_,
parameter_description = NA_character_,
medium = NA_character_,
statistical_basis = NA_character_,
weight_basis = NA_character_,
sample_fraction = NA_character_,
temperature_basis = NA_character_,
epa_equivalence = NA_character_,
properties = NA_character_,
limit = NA,
max_results = NA
)
Arguments
- parameter_code
Parameter code.
- parameter_name
Parameter short name.
- unit_of_measure
Parameter reporting units defined to cooperate with descriptions by USEPA.
- parameter_group_code
Categorical groupings of parameters by water-quality data type for display and report ordering
- parameter_description
Parameter description.
- medium
Parameter medium.
- statistical_basis
Parameter statistical basis.
- weight_basis
Parameter weight basis.
- sample_fraction
Parameter fraction.
- temperature_basis
Parameter temperature basis.
- epa_equivalence
Indicates the relationship of the USGS parameter code to the EPA code.
- properties
A vector of requested columns to be returned from the query. Available options are: geometry, id, parameter_name, unit_of_measure, parameter_group_code, parameter_description, medium, statistical_basis, time_basis, weight_basis, particle_size_basis, sample_fraction, temperature_basis, epa_equivalence.
- limit
The optional limit parameter is used to control the subset of the selected features that should be returned in each page. The maximum allowable limit is 10000. It may be beneficial to set this number lower if your internet connection is spotty. The default (
NA
) will set the limit to the maximum allowable limit for the service.- max_results
The optional maximum number of rows to return. This value must be less than the requested limit.
Examples
# \donttest{
pcode <- "00060"
pcode_info <- read_waterdata_parameter_codes(parameter_code = pcode)
#> Requesting:
#> https://api.waterdata.usgs.gov/ogcapi/v0/collections/parameter-codes/items?f=json&lang=en-US&skipGeometry=TRUE&limit=10000&id=00060
#> Remaining requests this hour:199
pcodes <- read_waterdata_parameter_codes(parameter_code = c("00660", "00060"))
#> Current API functionality requires pulling the full parameter-codes list.
#> It is expected that updates to the API will eliminate this need, but in the meantime
#> consider running read_waterdata_parameter_code() with no query parameters, and filtering
#> in a post-processing step.
#> Requesting:
#> https://api.waterdata.usgs.gov/ogcapi/v0/collections/parameter-codes/items?f=json&lang=en-US&skipGeometry=TRUE&limit=10000
#> Remaining requests this hour:199
#> Remaining requests this hour:199
# equivalent to read_waterdata_metadata("parameter-codes")
all_pcodes <- read_waterdata_parameter_codes()
#> Requesting:
#> https://api.waterdata.usgs.gov/ogcapi/v0/collections/parameter-codes/items?f=json&lang=en-US&skipGeometry=TRUE&limit=10000
#> Remaining requests this hour:197
#> Remaining requests this hour:196
total_nutrients <- read_waterdata_parameter_codes(parameter_group_code = "NUT",
sample_fraction = "Total")
#> Requesting:
#> https://api.waterdata.usgs.gov/ogcapi/v0/collections/parameter-codes/items?f=json&lang=en-US&skipGeometry=TRUE&limit=10000¶meter_group_code=NUT&sample_fraction=Total
#> Remaining requests this hour:195
group_of_nutrients <- read_waterdata_parameter_codes(parameter_group_code = "NUT",
unit_of_measure = c("mg/l",
"mg/l as N", "mg/l NO3",
"mg/l asNO2"))
#> Current API functionality requires pulling the full parameter-codes list.
#> It is expected that updates to the API will eliminate this need, but in the meantime
#> consider running read_waterdata_parameter_code() with no query parameters, and filtering
#> in a post-processing step.
#> Requesting:
#> https://api.waterdata.usgs.gov/ogcapi/v0/collections/parameter-codes/items?f=json&lang=en-US&skipGeometry=TRUE&limit=10000
#> Remaining requests this hour:195
#> Remaining requests this hour:195
# }