Thanks to visit codestin.com
Credit goes to github.com

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
81 changes: 70 additions & 11 deletions R/DataDiscoveryRetrieval.R
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,7 @@ TADA_TribalOptions <- function(tribal_area_type, return_sf = FALSE) {
#' comment within your code. This URL let's you return to the WQP query page
#' with all your selected data filters. For example, this is the query used
#' in the examples for this function:
#' https://www.waterqualitydata.us/#statecode=US%3A09&sampleMedia=water&sampleMedia=Water&startDateLo=01-01-2021&mimeType=csv&dataProfile=biological&providers=NWIS&providers=STEWARDS&providers=STORET
#' https://www.waterqualitydata.us/#statecode=US%3A09&sampleMedia=water&sampleMedia=Water&startDateLo=01-01-2021&startDateHi=02-01-2021&mimeType=csv&providers=NWIS&providers=STORET
#'
#' **Extra tip:** Note that the web service call built using the Water
#' Quality Portal uses the inputs startDateLo and startDateHi rather than
Expand All @@ -1069,9 +1069,38 @@ TADA_TribalOptions <- function(tribal_area_type, return_sf = FALSE) {
#'
#' @examples
#' \dontrun{
#' physchemresults1 <- TADA_ReadWQPWebServices("https://www.waterqualitydata.us/data/Result/search?statecode=US%3A09&sampleMedia=water&sampleMedia=Water&startDateLo=01-01-2021&mimeType=csv&zip=yes&dataProfile=biological&providers=NWIS&providers=STEWARDS&providers=STORET")
#' sites1 <- TADA_ReadWQPWebServices("https://www.waterqualitydata.us/data/Station/search?statecode=US%3A09&sampleMedia=water&sampleMedia=Water&startDateLo=01-01-2021&mimeType=csv&zip=yes&providers=NWIS&providers=STEWARDS&providers=STORET")
#' projects1 <- TADA_ReadWQPWebServices("https://www.waterqualitydata.us/data/Project/search?statecode=US%3A09&sampleMedia=water&sampleMedia=Water&startDateLo=01-01-2021&mimeType=csv&zip=yes&providers=NWIS&providers=STEWARDS&providers=STORET")
#' # construct the WQP web service URL for each profile
#' baseurl = "https://www.waterqualitydata.us/data/"
#' profile_station = "Station"
#' profile_result = "Result"
#' profile_result_2 = "&dataProfile=biological"
#' profile_project = "Project"
#' filters = "/search?statecode=US%3A09&sampleMedia=water&sampleMedia=Water"
#' dates = "&startDateLo=01-01-2021&startDateHi=02-01-2021"
#' type = "&mimeType=csv&zip=yes"
#' providers = "&providers=NWIS&providers=STEWARDS&providers=STORET"
#'
#' physchemresults1 <- TADA_ReadWQPWebServices(paste0(baseurl,
#' profile_station,
#' filters,
#' dates,
#' type,
#' providers))
#'
#' sites1 <- TADA_ReadWQPWebServices(paste0(baseurl,
#' profile_result,
#' filters,
#' dates,
#' type,
#' profile_result_2,
#' providers))
#'
#' projects1 <- TADA_ReadWQPWebServices(paste0(baseurl,
#' profile_project,
#' filters,
#' dates,
#' type,
#' providers))
#' }
#'
TADA_ReadWQPWebServices <- function(webservice) {
Expand Down Expand Up @@ -1240,6 +1269,10 @@ TADA_BigDataHelper <- function(record_summary, WQPquery, maxrecs = 250000, maxsi
#' After retrieving multiple result and metadata profiles from the WQP, this
#' function joins those profiles together into one dataframe.
#' The FullPhysChem data input is required to run this function.
#'
#' The WQP user interface assists users with constructing a web service query
#' URL - for example:
#' https://www.waterqualitydata.us/#statecode=US%3A09&characteristicType=Nutrient&startDateLo=04-01-2023&startDateHi=11-01-2023&mimeType=csv&providers=NWIS&providers=STEWARDS&providers=STORET
#'
#' @param FullPhysChem Full physical chemical data profile
#' @param Sites Sites data profile
Expand All @@ -1251,13 +1284,39 @@ TADA_BigDataHelper <- function(record_summary, WQPquery, maxrecs = 250000, maxsi
#'
#' @examples
#' \dontrun{
#' # Load WQP data
#' # WQP URL: https://www.waterqualitydata.us/#statecode=US%3A09&characteristicType=Nutrient&startDateLo=04-01-2023&startDateHi=11-01-2023&mimeType=csv&providers=NWIS&providers=STEWARDS&providers=STORET
#' # Use TADA_ReadWQPWebServices to load each profile
#' stationProfile <- TADA_ReadWQPWebServices("https://www.waterqualitydata.us/data/Station/search?statecode=US%3A09&characteristicType=Nutrient&startDateLo=04-01-2023&startDateHi=11-01-2023&mimeType=csv&zip=yes&providers=NWIS&providers=STEWARDS&providers=STORET")
#' physchemProfile <- TADA_ReadWQPWebServices("https://www.waterqualitydata.us/data/Result/search?statecode=US%3A09&characteristicType=Nutrient&startDateLo=04-01-2023&startDateHi=11-01-2023&mimeType=csv&zip=yes&dataProfile=resultPhysChem&providers=NWIS&providers=STEWARDS&providers=STORET")
#' projectProfile <- TADA_ReadWQPWebServices("https://www.waterqualitydata.us/data/Project/search?statecode=US%3A09&characteristicType=Nutrient&startDateLo=04-01-2023&startDateHi=11-01-2023&mimeType=csv&zip=yes&providers=NWIS&providers=STEWARDS&providers=STORET")
#'
#' # construct the WQP web service URL for each profile
#' baseurl = "https://www.waterqualitydata.us/data/"
#' profile_station = "Station"
#' profile_result = "Result"
#' profile_result_2 = "&dataProfile=resultPhysChem"
#' profile_project = "Project"
#' filters = "/search?statecode=US%3A09&characteristicType=Nutrient"
#' dates = "&startDateLo=04-01-2023&startDateHi=11-01-2023"
#' type = "&mimeType=csv&zip=yes"
#' providers = "&providers=NWIS&providers=STEWARDS&providers=STORET"
#'
#' stationProfile <- TADA_ReadWQPWebServices(paste0(baseurl,
#' profile_station,
#' filters,
#' dates,
#' type,
#' providers))
#'
#' physchemProfile <- TADA_ReadWQPWebServices(paste0(baseurl,
#' profile_result,
#' filters,
#' dates,
#' type,
#' profile_result_2,
#' providers))
#'
#' projectProfile <- TADA_ReadWQPWebServices(paste0(baseurl,
#' profile_project,
#' filters,
#' dates,
#' type,
#' providers))
#'
#' # Join all three profiles using TADA_JoinWQPProfiles
#' TADAProfile <- TADA_JoinWQPProfiles(
#' FullPhysChem = physchemProfile,
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Tools for Automated Data Analysis, or TADA, is being developed to help States, T

- [More about the TADA Project](https://www.epa.gov/waterdata/TADA)

![](images/TADA overview.png)
![](vignettes/images/overview.png)

## Installation

Expand Down
43 changes: 37 additions & 6 deletions man/TADA_JoinWQPProfiles.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 33 additions & 4 deletions man/TADA_ReadWQPWebServices.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading