View source: R/read_waterdata_peaks.R
| read_waterdata_peaks | R Documentation |
Annual peak flow values are the maximum instantaneous streamflow values recorded at a particular site for the entire water year from October 1 to September 30. Note that the annual peak flow value may not occur at the same time the maximum water level occurs due to conditions such as backwater, tidal fluctuations, etc.
read_waterdata_peaks(
monitoring_location_id = NA_character_,
parameter_code = NA_character_,
properties = NA_character_,
time_series_id = NA_character_,
unit_of_measure = NA_character_,
value = NA,
last_modified = NA_character_,
water_year = NA_character_,
year = NA_character_,
month = NA_character_,
day = NA_character_,
time_of_day = NA_character_,
peak_since = NA_character_,
skipGeometry = NA,
time = NA_character_,
bbox = NA,
...,
allow_incomplete_dates = FALSE,
convertType = getOption("dataRetrieval.convertType"),
no_paging = getOption("dataRetrieval.no_paging"),
chunk_size = getOption("dataRetrieval.site_chunk_size_meta"),
limit = getOption("dataRetrieval.limit"),
attach_request = getOption("dataRetrieval.attach_request")
)
monitoring_location_id |
A unique identifier representing a single monitoring location. This corresponds to the Multiple monitoring_location_ids can be requested as a character vector. |
parameter_code |
Parameter codes are 5-digit codes used to identify the constituent measured and the units of measure. A complete list of parameter codes and associated groupings can be found at https://api.waterdata.usgs.gov/ogcapi/v0/collections/parameter-codes/items. Multiple parameter_codes can be requested as a character vector. |
properties |
A vector of requested columns to be returned from the query.
Available options are:
geometry, time_series_id, monitoring_location_id, parameter_code, peak_id, unit_of_measure, value, last_modified, time, water_year, year, month, day, time_of_day, peak_since.
The default ( |
time_series_id |
A unique identifier representing a single time series. This corresponds to the |
unit_of_measure |
A human-readable description of the units of measurement associated with an observation. |
value |
The value of the observation. Values are transmitted as strings in the JSON response format in order to preserve precision. |
last_modified |
The last time a record was refreshed in our database. This may happen due to regular operational processes and does not necessarily indicate anything about the measurement has changed. You can query this field using date-times or intervals, adhering to RFC 3339, or using ISO 8601 duration objects. Intervals may be bounded or half-bounded (double-dots at start or end). Examples:
Only features that have a See also Details below for more information. |
water_year |
The water year (running from October 1st to September 30th) a peak occurred. |
year |
The calendar year a peak occurred. |
month |
The calendar month a peak occurred. If null, the month a peak occurred is unknown. |
day |
The day of the month a peak occurred. If null, the day a peak occurred is unknown. |
time_of_day |
The time of day a peak occurred. If null, the time of day a peak occurred is unknown. |
peak_since |
If not null, this record represents the peak value for the parameter code since the year contained in "peak_since". |
skipGeometry |
This parameter can be used to skip response geometries for
each feature. The returning object will be a data frame with no spatial
information. The default |
time |
The date an observation represents. You can query this field using date-times or intervals, adhering to RFC 3339, or using ISO 8601 duration objects. Intervals may be bounded or half-bounded (double-dots at start or end). Examples:
Only features that have a See also Details below for more information. |
bbox |
Only features that have a geometry that intersects the bounding box are selected.The bounding box is provided as four or six numbers, depending on whether the coordinate reference system includes a vertical axis (height or depth). Coordinates are assumed to be in crs 4326. The expected format is a numeric vector structured: c(xmin,ymin,xmax,ymax). Another way to think of it is c(Western-most longitude, Southern-most latitude, Eastern-most longitude, Northern-most longitude). |
... |
Not used. Included to help differentiate official Water Data API arguments from more seldom used, optional dataRetrieval-specific arguments. |
allow_incomplete_dates |
Specifically in the peaks data, exact peak dates
are not always known. Sometimes peaks are known just for the year, sometimes
they are known to the year and month, and and sometimes to the exact date.
This argument determines if incomplete dates + uncertain month/day values are
allowed in the "time" column so that it can be a complete Date object ( |
convertType |
logical, defaults to TRUE.
If |
no_paging |
logical, defaults to FALSE.
If |
chunk_size |
Number of monitoring_location_ids to chunk requests into.
The default for functions that don't generally return long-term data records
is 250, while
the default for time series functions is
10.
Setting to |
limit |
numeric, 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 50,000. It may be beneficial to set this number lower if your internet
connection is spotty. The default ( |
attach_request |
logical, defaults to TRUE.
If set to |
You can also use a vector of length 2 for any time queries (such as time
or last_modified). The first value is the starting date (or datetime),
the second value is the ending date(or datetime).
NA's within the vector indicate a half-bound date.
For example, time = c("2024-01-01", NA) will return all data starting
at 2024-01-01.
time = c(NA, "2024-01-01") will return all data from the beginning of
the timeseries until 2024-01-01.
By default, time is assumed UTC, although time zone attributes
will be accommodated. As an example, setting time = as.POSIXct(c("2021-01-01 12:00:00",
"2021-01-01 14:00"), tz = "America/New_York") will request data that between
noon and 2pm eastern time on 2021-01-01.
All time values RETURNED from the service are UTC with the exception of
daily data, which returns time values in local dates.
wi_peaks <- read_waterdata_combined_meta(
state_name = "Wisconsin",
data_type = "Peaks",
parameter_code = "00060")
dv_data_sf <- read_waterdata_peaks(
monitoring_location_id = wi_peaks$monitoring_location_id[1],
parameter_code = "00060")
incomplete_dates_not_allowed <- read_waterdata_peaks(
monitoring_location_id = "USGS-06334330",
parameter_code = "00060")
incomplete_dates_not_allowed$time
incomplete_dates_allowed <- read_waterdata_peaks(
monitoring_location_id = "USGS-06334330",
parameter_code = "00060",
allow_incomplete_dates = TRUE)
incomplete_dates_allowed$time
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.