Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,5 @@ vignettes/continuous_pr.Rmd
vignettes/quick_slides.Rmd
^[.]?air[.]toml$
^\.vscode$
^\.positai$
^\.claude$
10 changes: 7 additions & 3 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,23 @@ jobs:
any::pkgdown
any::rcmdcheck
any::DT
any::data.table
any::dplyr
any::tidyr
any::ggplot2
any::zoo
any::sf
any::patchwork
any::maps
any::reticulate
any::leaflet
any::readxl
any::gridExtra
local::.
needs: website
- name: Setup Micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment.yml
cache-environment: false
cache-downloads: false
- name: Create public directory
run: |
mkdir public
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ vignettes/*.R
/.quarto/

**/*.quarto_ipynb
.positai
53 changes: 19 additions & 34 deletions R/readNWISunit.R
Original file line number Diff line number Diff line change
Expand Up @@ -58,25 +58,10 @@
#' endDate <- "2014-10-10"
#' \donttest{
#'
#' rawData <- readNWISuv(site_id, parameterCd, startDate, endDate)
#' #rawData <- readNWISuv(site_id, parameterCd, startDate, endDate)
#'
#' rawData_today <- readNWISuv(site_id, parameterCd, Sys.Date(), Sys.Date())
#' #rawData_today <- readNWISuv(site_id, parameterCd, Sys.Date(), Sys.Date())
#'
#' timeZoneChange <- readNWISuv(
#' c("04024430", "04024000"), parameterCd,
#' "2013-11-03", "2013-11-03"
#' )
#'
#' centralTime <- readNWISuv(site_id, parameterCd,
#' "2014-10-10T12:00", "2014-10-10T23:59",
#' tz = "America/Chicago"
#' )
#'
#' # Adding 'Z' to the time indicates to the web service to call the data with UTC time:
#' GMTdata <- readNWISuv(
#' site_id, parameterCd,
#' "2014-10-10T00:00Z", "2014-10-10T23:59Z"
#' )
#' }
readNWISuv <- function(
siteNumbers,
Expand Down Expand Up @@ -352,28 +337,28 @@ readNWISrating <- function(siteNumber, type = "base", convertType = TRUE) {
#' @export
#' @examplesIf is_dataRetrieval_user()
#' \donttest{
#' x1 <- readNWISstat(
#' siteNumbers = c("02319394"),
#' parameterCd = c("00060"),
#' statReportType = "annual"
#' )
#' # x1 <- readNWISstat(
#' # siteNumbers = c("02319394"),
#' # parameterCd = c("00060"),
#' # statReportType = "annual"
#' # )
#'
#' # all the annual mean discharge data for two sites
#' x2 <- readNWISstat(
#' siteNumbers = c("02319394", "02171500"),
#' parameterCd = c("00010", "00060"),
#' statReportType = "annual"
#' )
#' #x2 <- readNWISstat(
#' # siteNumbers = c("02319394", "02171500"),
#' # parameterCd = c("00010", "00060"),
#' # statReportType = "annual"
#' # )
#'
#' # Request p25, p75, and mean values for temperature and discharge for the 2000s
#' # Note that p25 and p75 were not available for temperature, and return NAs
#' x <- readNWISstat(
#' siteNumbers = c("02171500"),
#' parameterCd = c("00010", "00060"),
#' statReportType = "daily",
#' statType = c("mean", "median"),
#' startDate = "2000", endDate = "2010"
#' )
#' #x <- readNWISstat(
#' # siteNumbers = c("02171500"),
#' # parameterCd = c("00010", "00060"),
#' # statReportType = "daily",
#' # statType = c("mean", "median"),
#' # startDate = "2000", endDate = "2010"
#' # )
#' }
readNWISstat <- function(
siteNumbers,
Expand Down
202 changes: 101 additions & 101 deletions R/readWQPdata.R
Original file line number Diff line number Diff line change
Expand Up @@ -86,62 +86,62 @@
#' \donttest{
#'
#' # Legacy:
#' nameToUse <- "pH"
#' pHData <- readWQPdata(siteid = "USGS-04024315",
#' characteristicName = nameToUse)
#' ncol(pHData)
#' attr(pHData, "siteInfo")
#' attr(pHData, "queryTime")
#' attr(pHData, "url")
#' #nameToUse <- "pH"
#' #pHData <- readWQPdata(siteid = "USGS-04024315",
#' # characteristicName = nameToUse)
#' #ncol(pHData)
#' #attr(pHData, "siteInfo")
#' #attr(pHData, "queryTime")
#' #attr(pHData, "url")
#'
#' # WQX3:
#' pHData_wqx3 <- readWQPdata(siteid = "USGS-04024315",
#' characteristicName = nameToUse,
#' service = "ResultWQX3",
#' dataProfile = "basicPhysChem")
#' attr(pHData_wqx3, "url")
#' #pHData_wqx3 <- readWQPdata(siteid = "USGS-04024315",
#' # characteristicName = nameToUse,
#' # service = "ResultWQX3",
#' # dataProfile = "basicPhysChem")
#' # attr(pHData_wqx3, "url")
#'
#' # More examples:
#' # querying by county
#' DeWitt <- readWQPdata(
#' statecode = "Illinois",
#' countycode = "DeWitt",
#' characteristicName = "Nitrogen"
#' )
#' #DeWitt <- readWQPdata(
#' # statecode = "Illinois",
#' # countycode = "DeWitt",
#' # characteristicName = "Nitrogen"
#' # )
#'
#' attr(DeWitt, "url")
#' #attr(DeWitt, "url")
#'
#' DeWitt_wqx3 <- readWQPdata(
#' statecode = "Illinois",
#' countycode = "DeWitt",
#' characteristicName = "Nitrogen",
#' service = "ResultWQX3",
#' dataProfile = "basicPhysChem",
#' ignore_attributes = TRUE)
#' #DeWitt_wqx3 <- readWQPdata(
#' # statecode = "Illinois",
#' # countycode = "DeWitt",
#' # characteristicName = "Nitrogen",
#' # service = "ResultWQX3",
#' # dataProfile = "basicPhysChem",
#' # ignore_attributes = TRUE)
#'
#' attr(DeWitt_wqx3, "url")
#' #attr(DeWitt_wqx3, "url")
#'
#' # Data profile: "Sampling Activity"
#' activity <- readWQPdata(
#' siteid = "USGS-04024315",
#' service = "Activity"
#' )
#' attr(activity, "url")
#' #activity <- readWQPdata(
#' # siteid = "USGS-04024315",
#' # service = "Activity"
#' #)
#' #attr(activity, "url")
#'
#' # activity_wqx3 <- readWQPdata(
#' # siteid = "USGS-04024315",
#' # service = "ActivityWQX3"
#' # )
#' # attr(activity_wqx3, "url")
#'
#' Dane_activity <- readWQPdata(
#' statecode = "Wisconsin",
#' countycode = "Dane",
#' startDateLo = "2023-01-01",
#' startDateHi = "2023-12-31",
#' service = "Activity"
#' )
#' attr(Dane_activity, "url")
#' #Dane_activity <- readWQPdata(
#' # statecode = "Wisconsin",
#' # countycode = "Dane",
#' # startDateLo = "2023-01-01",
#' # startDateHi = "2023-12-31",
#' # service = "Activity"
#' # )
#' #attr(Dane_activity, "url")
#'
#' # Dane_activity_wqx3 <- readWQPdata(
#' # statecode = "Wisconsin",
Expand All @@ -157,47 +157,47 @@
#'
#'
#' # Data profiles: "Organization Data"
#' org_data <- readWQPdata(
#' statecode = "WI",
#' countycode = "Dane",
#' service = "Organization"
#' )
#' #org_data <- readWQPdata(
#' # statecode = "WI",
#' # countycode = "Dane",
#' # service = "Organization"
#' # )
#'
#' # Data profiles: "Project Data"
#' project_data <- readWQPdata(
#' statecode = "WI",
#' countycode = "Dane",
#' service = "Project"
#' )
#' #project_data <- readWQPdata(
#' # statecode = "WI",
#' # countycode = "Dane",
#' # service = "Project"
#' # )
#'
#' # Data profiles: "Project Monitoring Location Weighting Data"
#' proj_mlwd <- readWQPdata(
#' statecode = "WI",
#' countycode = "Dane",
#' service = "ProjectMonitoringLocationWeighting"
#' )
#' #proj_mlwd <- readWQPdata(
#' # statecode = "WI",
#' # countycode = "Dane",
#' # service = "ProjectMonitoringLocationWeighting"
#' # )
#'
#' # Data profiles: "Sample Results (physical/chemical metadata)"
#' samp_data <- readWQPdata(
#' siteid = "USGS-04024315",
#' dataProfile = "resultPhysChem",
#' service = "Result"
#' )
#' # samp_data <- readWQPdata(
#' # siteid = "USGS-04024315",
#' # dataProfile = "resultPhysChem",
#' # service = "Result"
#' # )
#'
#' # Data profiles: "Sample Results (biological metadata)"
#' samp_bio <- readWQPdata(
#' siteid = "USGS-04024315",
#' dataProfile = "biological",
#' service = "Result"
#' )
#' #samp_bio <- readWQPdata(
#' # siteid = "USGS-04024315",
#' # dataProfile = "biological",
#' # service = "Result"
#' # )
#'
#'
#' # Data profiles: "Sample Results (narrow)"
#' samp_narrow <- readWQPdata(
#' siteid = "USGS-04024315",
#' service = "Result",
#' dataProfile = "narrowResult"
#' )
#' # samp_narrow <- readWQPdata(
#' # siteid = "USGS-04024315",
#' # service = "Result",
#' # dataProfile = "narrowResult"
#' # )
#'
#' # samp_narrow_wqx3 <- readWQPdata(
#' # siteid = "USGS-04024315",
Expand All @@ -207,38 +207,38 @@
#'
#'
#' # Data profiles: "Sampling Activity"
#' samp_activity <- readWQPdata(
#' siteid = "USGS-04024315",
#' dataProfile = "activityAll",
#' service = "Activity"
#' )
#' #samp_activity <- readWQPdata(
#' # siteid = "USGS-04024315",
#' # dataProfile = "activityAll",
#' # service = "Activity"
#' # )
#'
#' # Data profile: "Sampling Activity Metrics"
#' act_metrics <- readWQPdata(
#' statecode = "WI",
#' countycode = "Dane",
#' service = "ActivityMetric"
#' )
#' # act_metrics <- readWQPdata(
#' # statecode = "WI",
#' # countycode = "Dane",
#' # service = "ActivityMetric"
#' # )
#'
#' # Data profile: "Result Detection Quantitation Limit Data"
#' dl_data <- readWQPdata(
#' siteid = "USGS-04024315",
#' service = "ResultDetectionQuantitationLimit"
#' )
#' # dl_data <- readWQPdata(
#' # siteid = "USGS-04024315",
#' # service = "ResultDetectionQuantitationLimit"
#' # )
#'
#' # other options:
#' Phosphorus <- readWQPdata(
#' statecode = "WI", countycode = "Dane",
#' characteristicName = "Phosphorus",
#' startDateLo = "2023-01-01",
#' ignore_attributes = TRUE,
#' convertType = FALSE
#' )
#'
#' rawPHsites_legacy <- readWQPdata(siteid = c("USGS-05406450", "USGS-05427949", "WIDNR_WQX-133040"),
#' characteristicName = "pH",
#' service = "Result",
#' dataProfile = "narrowResult" )
#' # Phosphorus <- readWQPdata(
#' # statecode = "WI", countycode = "Dane",
#' # characteristicName = "Phosphorus",
#' # startDateLo = "2023-01-01",
#' # ignore_attributes = TRUE,
#' # convertType = FALSE
#' # )
#'
#' #rawPHsites_legacy <- readWQPdata(siteid = c("USGS-05406450", "USGS-05427949", "WIDNR_WQX-133040"),
#' # characteristicName = "pH",
#' # service = "Result",
#' # dataProfile = "narrowResult" )
#'
#' # rawPHsites <- readWQPdata(siteid = c("USGS-05406450", "USGS-05427949", "WIDNR_WQX-133040"),
#' # characteristicName = "pH",
Expand Down Expand Up @@ -416,12 +416,12 @@ create_WQP_attributes <- function(retval, ...) {
#'
#' @examplesIf is_dataRetrieval_user()
#' \donttest{
#' rawPcode <- readWQPqw("USGS-01594440", "01075",
#' ignore_attributes = TRUE, legacy = FALSE)
#' headerInfo <- attr(rawPcode, "headerInfo")
#' wqp_request_id <- headerInfo$`wqp-request-id`
#' count_info <- wqp_check_status(wqp_request_id)
#' count_info[["dataProviders"]]
#' #rawPcode <- readWQPqw("USGS-01594440", "01075",
#' # ignore_attributes = TRUE, legacy = FALSE)
#' # headerInfo <- attr(rawPcode, "headerInfo")
#' #wqp_request_id <- headerInfo$`wqp-request-id`
#' #count_info <- wqp_check_status(wqp_request_id)
#' #count_info[["dataProviders"]]
#' }
wqp_check_status <- function(wqp_request_id) {
id_url <- paste0(pkg.env[["status"]], wqp_request_id)
Expand Down
Loading
Loading