% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/read_waterdata_stats.R
\name{read_waterdata_stats_por}
\alias{read_waterdata_stats_por}
\alias{read_waterdata_stats_daterange}
\title{Get USGS daily data statistics}
\usage{
read_waterdata_stats_por(
  approval_status = NA,
  computation_type = NA_character_,
  country_code = NA_character_,
  state_code = NA_character_,
  county_code = NA_character_,
  start_date = NA_character_,
  end_date = NA_character_,
  normal_type = NA_character_,
  monitoring_location_id = NA_character_,
  parent_time_series_id = NA_character_,
  site_type_code = NA_character_,
  site_type_name = NA_character_,
  parameter_code = NA_character_,
  page_size = NA
)

read_waterdata_stats_daterange(
  approval_status = NA,
  computation_type = NA_character_,
  country_code = NA_character_,
  state_code = NA_character_,
  county_code = NA_character_,
  start_date = NA_character_,
  end_date = NA_character_,
  interval_type = NA_character_,
  monitoring_location_id = NA_character_,
  parent_time_series_id = NA_character_,
  site_type_code = NA_character_,
  site_type_name = NA_character_,
  parameter_code = NA_character_,
  page_size = NA
)
}
\arguments{
\item{approval_status}{Whether to include approved and/or provisional
observations. At this time, only approved observations are returned.}

\item{computation_type}{Desired statistical computation method. Available
values: "arithmetic_mean", "maximum", "median", "minimum", "percentile".}

\item{country_code}{Country Query Parameter. Accepts multiple values (see
examples). If one of country, county, or state code is supplied then the
other two arguments do not need to be specified.}

\item{state_code}{State Query Parameter. Accepts multiple values in a
character vector.}

\item{county_code}{County Query Parameter. Accepts multiple values in a
character vector.}

\item{start_date}{Start Date Query Parameter. The logic is inclusive i.e., it
will also return records that match the date. If an end date is supplied,
but no start date is supplied, then statistics will be supplied for the
entire period of record ending with the end date. If an end date is not
supplied, but a start date is supplied then statistics will be supplied for
the period of record following the start date. If no start or end date are
supplied then statistics will be supplied for the entire period of record.}

\item{end_date}{End Date Query Parameter. The logic is inclusive i.e., it will
also return records that match the date.}

\item{normal_type}{Normal Type Query Parameter. If unspecified, all matching data
will be returned. Otherwise, it will filter the results to one of the following
normals: day-of-year, month-of-year. Available values: "DOY", "MOY".}

\item{monitoring_location_id}{Each monitoring location has been assigned a
unique station number that places them in downstream order. Accepts
multiple values in a character vector.}

\item{parent_time_series_id}{The parent_time_series_id returns statistics
tied to a particular database entry. Accepts multiple values in a character
vector. If no parent time series identifier is supplied, then all records
matching the rest of the provided criteria will be returned.}

\item{site_type_code}{Site Type Code Query Parameter. Accepts multiple values
in a character vector. If no Site Type code is specified, statistics of all
site types with the matching Monitoring Location Identifier will be
returned.}

\item{site_type_name}{Site Type Name Query Parameter. If no Site Type name is
specified, statistics of all site types with the matching Monitoring
Location Identifier will be returned.}

\item{parameter_code}{USGS Parameter Code Query Parameter. Accepts multiple
values in a character vector. If no USGS parameter code is specified, but a
Monitoring Location Identifier is supplied, then all statistics and their
parameter codes with a matching monitoring location identifier will be
returned. All statistics within the period of record will be returned if no
parameter code or monitoring location identifier are specified.}

\item{page_size}{Return a defined number of results (default: 1000).}

\item{interval_type}{Interval Type Query Parameter. If unspecified, all matching
data will be returned. Otherwise, it will filter the results to one or more of
the following intervals: month, calendar year, water year.
Available values: "M", "CY", "WY".}
}
\description{
This service provides endpoints for access to computations on the historical
record regarding water conditions. For more information regarding the
calculation of statistics and other details, please visit the Statistics
documentation page.

Note: The /statistics API is under active beta development and subject to change.
Improved handling of significant figures will be addressed in a future
release.

\code{read_waterdata_stats_por} Returns day-of-year and month-of-year
statistics matching your query.

\code{read_waterdata_stats_daterange} Returns monthly and annual statistics matching
your query.
}
\examples{
\dontshow{if (is_dataRetrieval_user()) withAutoprint(\{ # examplesIf}

\donttest{
# All day-of-year and month-of-year statistics for two sites
x1 <- read_waterdata_stats_por(
  monitoring_location_id = c("USGS-02319394", "USGS-02171500")
)

# Request only month-of-year statistics using normal_type arg
x1 <- read_waterdata_stats_por(
  monitoring_location_id = c("USGS-02319394", "USGS-02171500"),
  normal_type = "MOY"
)

# Request temperature percentiles for specific month-day range
# Returns:
# - Day-of-year temperature percentiles for each day between June 1 through June 15.
# - Month-of-year percentiles for June, computed using
#    all June data (not just June 1 through June 15).
# Note: the month-of-year percentiles are returned only when the month-day range includes
#  the beginning of the month (e.g., "06-01")
x2 <- read_waterdata_stats_por(
  monitoring_location_id = c("USGS-02319394", "USGS-02171500"),
  parameter_code = "00010",
  start_date = "06-01", end_date = "06-15",
  computation_type = "percentile"
)

# All calendar month, calendar year, and water year statistics for two sites
x3 <- read_waterdata_stats_daterange(
  monitoring_location_id = c("USGS-02319394", "USGS-02171500")
)

# Request only calendar year statistics
x3 <- read_waterdata_stats_daterange(
  monitoring_location_id = c("USGS-02319394", "USGS-02171500"),
  interval_type = "CY"
)

# Request specific gage height and discharge summaries for a limited date range
# Returns:
# - calendar month summaries for each month between January, 2010 through December, 2011
# - calendar year summaries for 2010 and 2011
# - water year summaries for WY2010, WY2011, and WY2012
x4 <- read_waterdata_stats_daterange(
  monitoring_location_id = c("USGS-02319394", "USGS-02171500"),
  parameter_code = c("00065", "00060"),
  start_date = "2010-01-01", end_date = "2011-12-31",
  computation_type = c("minimum", "median", "maximum")
)

}
\dontshow{\}) # examplesIf}
}
\seealso{
\url{https://api.waterdata.usgs.gov/statistics/v0/docs}
}
