Unverified Commit b60c41a2 authored by Laura A DeCicco's avatar Laura A DeCicco Committed by GitHub
Browse files

Merge pull request #582 from ldecicco-USGS/master

Try some new roxygen2 fanciness
parents 87705271 9be10fc9
...@@ -32,6 +32,8 @@ vignettes/usMaps_cache ...@@ -32,6 +32,8 @@ vignettes/usMaps_cache
vignettes/movingAverages.Rmd vignettes/movingAverages.Rmd
vignettes/tutorial_slides.Rmd vignettes/tutorial_slides.Rmd
vignettes/nldi* vignettes/nldi*
vignettes/phWI.rds
vignettes/az_data.rds
vignettes/atascadero-creek-nldi.png vignettes/atascadero-creek-nldi.png
vignettes/ucsb.png vignettes/ucsb.png
man/figures/highrezlogo-01.png man/figures/highrezlogo-01.png
......
...@@ -21,7 +21,7 @@ jobs: ...@@ -21,7 +21,7 @@ jobs:
- name: Install pak and query dependencies - name: Install pak and query dependencies
run: | run: |
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/") install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/")
install.packages(c("maptools", "maps", "patchwork")) install.packages(c("DT", "leaflet", "zoo", "maps", "patchwork"))
saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds") saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds")
shell: Rscript {0} shell: Rscript {0}
...@@ -44,7 +44,6 @@ jobs: ...@@ -44,7 +44,6 @@ jobs:
- name: Deploy package - name: Deploy package
run: | run: |
Sys.setenv(CI = FALSE)
options(rmarkdown.html_vignette.check_title = FALSE) options(rmarkdown.html_vignette.check_title = FALSE)
pkgdown::deploy_to_branch(new_process = FALSE) pkgdown::deploy_to_branch(new_process = FALSE)
shell: Rscript {0} shell: Rscript {0}
...@@ -55,4 +55,4 @@ BuildVignettes: true ...@@ -55,4 +55,4 @@ BuildVignettes: true
VignetteBuilder: knitr VignetteBuilder: knitr
BugReports: https://github.com/USGS-R/dataRetrieval/issues BugReports: https://github.com/USGS-R/dataRetrieval/issues
URL: https://pubs.usgs.gov/tm/04/a10/ URL: https://pubs.usgs.gov/tm/04/a10/
RoxygenNote: 7.1.1 RoxygenNote: 7.1.2
...@@ -16,6 +16,7 @@ export(importRDB1) ...@@ -16,6 +16,7 @@ export(importRDB1)
export(importWQP) export(importWQP)
export(importWaterML1) export(importWaterML1)
export(importWaterML2) export(importWaterML2)
export(is_dataRetrieval_user)
export(pCodeToName) export(pCodeToName)
export(parameterCdFile) export(parameterCdFile)
export(readNGWMNdata) export(readNGWMNdata)
......
...@@ -5,3 +5,16 @@ pkg.env <- new.env() ...@@ -5,3 +5,16 @@ pkg.env <- new.env()
pkg.env$nldi_base <- "https://labs.waterdata.usgs.gov/api/nldi/linked-data/" pkg.env$nldi_base <- "https://labs.waterdata.usgs.gov/api/nldi/linked-data/"
pkg.env$local_sf <- requireNamespace("sf", quietly = TRUE) pkg.env$local_sf <- requireNamespace("sf", quietly = TRUE)
} }
#' Is this a dataRetrieval user
#'
#' Reveals if this is a user or not
#' @export
#' @examples
#' is_dataRetrieval_user()
is_dataRetrieval_user <- function(){
interactive() ||
!identical(Sys.getenv("CI"), "") ||
identical(Sys.getenv("NOT_CRAN"), "true")
}
...@@ -225,7 +225,7 @@ valid_ask = function(all, type) { ...@@ -225,7 +225,7 @@ valid_ask = function(all, type) {
#' @return a list of data.frames if sf is not installed, a list of sf objects if it is #' @return a list of data.frames if sf is not installed, a list of sf objects if it is
#' @export #' @export
#' @keywords nldi #' @keywords nldi
#' @examples #' @examplesIf is_dataRetrieval_user()
#' \donttest{ #' \donttest{
#' # Find Features / Define origin features #' # Find Features / Define origin features
#' #'
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#' @importFrom xml2 read_xml #' @importFrom xml2 read_xml
#' @export #' @export
#' @return raw data from web services #' @return raw data from web services
#' @examples #' @examplesIf is_dataRetrieval_user()
#' siteNumber <- "02177000" #' siteNumber <- "02177000"
#' startDate <- "2012-09-01" #' startDate <- "2012-09-01"
#' endDate <- "2012-10-01" #' endDate <- "2012-10-01"
......
...@@ -136,7 +136,7 @@ importNGWMN <- function(input, asDateTime=FALSE, tz="UTC"){ ...@@ -136,7 +136,7 @@ importNGWMN <- function(input, asDateTime=FALSE, tz="UTC"){
#' "America/Anchorage","America/Honolulu","America/Jamaica","America/Managua","America/Phoenix", and "America/Metlakatla" #' "America/Anchorage","America/Honolulu","America/Jamaica","America/Managua","America/Phoenix", and "America/Metlakatla"
#' @importFrom xml2 xml_attr xml_find_all xml_text #' @importFrom xml2 xml_attr xml_find_all xml_text
#' @export #' @export
#' @examples #' @examplesIf is_dataRetrieval_user()
#' baseURL <- "https://waterservices.usgs.gov/nwis/dv/?format=waterml,2.0" #' baseURL <- "https://waterservices.usgs.gov/nwis/dv/?format=waterml,2.0"
#' URL <- paste(baseURL, "sites=01646500", #' URL <- paste(baseURL, "sites=01646500",
#' "startDT=2014-09-01", #' "startDT=2014-09-01",
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
#' comment \tab character \tab Header comments from the RDB file \cr #' comment \tab character \tab Header comments from the RDB file \cr
#' } #' }
#' @export #' @export
#' @examples #' @examplesIf is_dataRetrieval_user()
#' site_id <- "02177000" #' site_id <- "02177000"
#' startDate <- "2012-09-01" #' startDate <- "2012-09-01"
#' endDate <- "2012-10-01" #' endDate <- "2012-10-01"
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#' start and end times, and converted to UTC. See \url{https://www.waterqualitydata.us/portal_userguide/} for more information. #' start and end times, and converted to UTC. See \url{https://www.waterqualitydata.us/portal_userguide/} for more information.
#' @export #' @export
#' @seealso \code{\link{readWQPdata}}, \code{\link{readWQPqw}}, \code{\link{whatWQPsites}} #' @seealso \code{\link{readWQPdata}}, \code{\link{readWQPqw}}, \code{\link{whatWQPsites}}
#' @examples #' @examplesIf is_dataRetrieval_user()
#' # These examples require an internet connection to run #' # These examples require an internet connection to run
#' #'
#' ## Examples take longer than 5 seconds: #' ## Examples take longer than 5 seconds:
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
#' @importFrom xml2 xml_attrs #' @importFrom xml2 xml_attrs
#' @importFrom xml2 xml_attr #' @importFrom xml2 xml_attr
#' @importFrom xml2 xml_root #' @importFrom xml2 xml_root
#' @examples #' @examplesIf is_dataRetrieval_user()
#' site_id <- "02177000" #' site_id <- "02177000"
#' startDate <- "2012-09-01" #' startDate <- "2012-09-01"
#' endDate <- "2012-10-01" #' endDate <- "2012-10-01"
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#' "America/Jamaica","America/Managua","America/Phoenix", and "America/Metlakatla". See also \code{OlsonNames()} #' "America/Jamaica","America/Managua","America/Phoenix", and "America/Metlakatla". See also \code{OlsonNames()}
#' for more information on time zones. #' for more information on time zones.
#' @export #' @export
#' @examples #' @examplesIf is_dataRetrieval_user()
#' \donttest{ #' \donttest{
#' #one site #' #one site
#' site <- "USGS.430427089284901" #' site <- "USGS.430427089284901"
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
#' #'
#' @seealso \code{\link{renameNWISColumns}}, \code{\link{importWaterML1}}, \code{\link{importRDB1}} #' @seealso \code{\link{renameNWISColumns}}, \code{\link{importWaterML1}}, \code{\link{importRDB1}}
#' @export #' @export
#' @examples #' @examplesIf is_dataRetrieval_user()
#' \donttest{ #' \donttest{
#' # Examples not run for time considerations #' # Examples not run for time considerations
#' #'
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#' @seealso \code{\link{renameNWISColumns}}, \code{\link{importWaterML1}} #' @seealso \code{\link{renameNWISColumns}}, \code{\link{importWaterML1}}
#' @export #' @export
#' @keywords data import USGS web service #' @keywords data import USGS web service
#' @examples #' @examplesIf is_dataRetrieval_user()
#' site_id <- '04085427' #' site_id <- '04085427'
#' startDate <- '2012-01-01' #' startDate <- '2012-01-01'
#' endDate <- '2012-06-30' #' endDate <- '2012-06-30'
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
#' comment \tab character \tab Header comments from the RDB file \cr #' comment \tab character \tab Header comments from the RDB file \cr
#' } #' }
#' @export #' @export
#' @examples #' @examplesIf is_dataRetrieval_user()
#' \donttest{ #' \donttest{
#' #'
#' siteINFO <- readNWISsite('05114000') #' siteINFO <- readNWISsite('05114000')
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
#' #'
#' @seealso \code{\link{renameNWISColumns}}, \code{\link{importWaterML1}} #' @seealso \code{\link{renameNWISColumns}}, \code{\link{importWaterML1}}
#' @export #' @export
#' @examples #' @examplesIf is_dataRetrieval_user()
#' site_id <- '05114000' #' site_id <- '05114000'
#' parameterCd <- '00060' #' parameterCd <- '00060'
#' startDate <- "2014-10-10" #' startDate <- "2014-10-10"
...@@ -130,7 +130,7 @@ readNWISuv <- function (siteNumbers,parameterCd,startDate="",endDate="", tz="UTC ...@@ -130,7 +130,7 @@ readNWISuv <- function (siteNumbers,parameterCd,startDate="",endDate="", tz="UTC
#' } #' }
#' @seealso \code{\link{constructNWISURL}}, \code{\link{importRDB1}} #' @seealso \code{\link{constructNWISURL}}, \code{\link{importRDB1}}
#' @export #' @export
#' @examples #' @examplesIf is_dataRetrieval_user()
#' site_ids <- c('01594440','040851325') #' site_ids <- c('01594440','040851325')
#' \donttest{ #' \donttest{
#' data <- readNWISpeak(site_ids) #' data <- readNWISpeak(site_ids)
...@@ -213,7 +213,7 @@ readNWISpeak <- function (siteNumbers,startDate="",endDate="", asDateTime=TRUE, ...@@ -213,7 +213,7 @@ readNWISpeak <- function (siteNumbers,startDate="",endDate="", asDateTime=TRUE,
#'relate flow to stage. #'relate flow to stage.
#' @seealso \code{\link{constructNWISURL}}, \code{\link{importRDB1}} #' @seealso \code{\link{constructNWISURL}}, \code{\link{importRDB1}}
#' @export #' @export
#' @examples #' @examplesIf is_dataRetrieval_user()
#' site_id <- '01594440' #' site_id <- '01594440'
#' \donttest{ #' \donttest{
#' data <- readNWISrating(site_id, "base") #' data <- readNWISrating(site_id, "base")
...@@ -294,7 +294,7 @@ readNWISrating <- function (siteNumber,type="base",convertType = TRUE){ ...@@ -294,7 +294,7 @@ readNWISrating <- function (siteNumber,type="base",convertType = TRUE){
#' } #' }
#' @seealso \code{\link{constructNWISURL}}, \code{\link{importRDB1}} #' @seealso \code{\link{constructNWISURL}}, \code{\link{importRDB1}}
#' @export #' @export
#' @examples #' @examplesIf is_dataRetrieval_user()
#' site_ids <- c('01594440','040851325') #' site_ids <- c('01594440','040851325')
#' \donttest{ #' \donttest{
#' data <- readNWISmeas(site_ids) #' data <- readNWISmeas(site_ids)
...@@ -401,7 +401,7 @@ readNWISmeas <- function (siteNumbers,startDate="",endDate="", tz="UTC", expande ...@@ -401,7 +401,7 @@ readNWISmeas <- function (siteNumbers,startDate="",endDate="", tz="UTC", expande
#' #'
#' @seealso \code{\link{constructNWISURL}}, \code{\link{importRDB1}} #' @seealso \code{\link{constructNWISURL}}, \code{\link{importRDB1}}
#' @export #' @export
#' @examples #' @examplesIf is_dataRetrieval_user()
#' site_id <- "434400121275801" #' site_id <- "434400121275801"
#' \donttest{ #' \donttest{
#' data <- readNWISgwl(site_id) #' data <- readNWISgwl(site_id)
...@@ -478,7 +478,7 @@ readNWISgwl <- function(siteNumbers, startDate = "", endDate = "", ...@@ -478,7 +478,7 @@ readNWISgwl <- function(siteNumbers, startDate = "", endDate = "",
#' } #' }
#' @seealso \code{\link{constructNWISURL}}, \code{\link{importRDB1}} #' @seealso \code{\link{constructNWISURL}}, \code{\link{importRDB1}}
#' @export #' @export
#' @examples #' @examplesIf is_dataRetrieval_user()
#' \donttest{ #' \donttest{
#' x1 <- readNWISstat(siteNumbers=c("02319394"), #' x1 <- readNWISstat(siteNumbers=c("02319394"),
#' parameterCd=c("00060"), #' parameterCd=c("00060"),
...@@ -549,7 +549,7 @@ readNWISstat <- function(siteNumbers, parameterCd, startDate = "", endDate = "", ...@@ -549,7 +549,7 @@ readNWISstat <- function(siteNumbers, parameterCd, startDate = "", endDate = "",
#' County and state fields will be included as appropriate. #' County and state fields will be included as appropriate.
#' #'
#' @export #' @export
#' @examples #' @examplesIf is_dataRetrieval_user()
#' \donttest{ #' \donttest{
#' #All data for a county #' #All data for a county
#' allegheny <- readNWISuse(stateCd = "Pennsylvania",countyCd = "Allegheny") #' allegheny <- readNWISuse(stateCd = "Pennsylvania",countyCd = "Allegheny")
......
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
#' queryTime \tab POSIXct \tab The time the data was returned \cr #' queryTime \tab POSIXct \tab The time the data was returned \cr
#' } #' }
#' @export #' @export
#' @examples #' @examplesIf is_dataRetrieval_user()
#' \donttest{ #' \donttest{
#' nameToUse <- "pH" #' nameToUse <- "pH"
#' pHData <- readWQPdata(siteid="USGS-04024315",characteristicName=nameToUse) #' pHData <- readWQPdata(siteid="USGS-04024315",characteristicName=nameToUse)
......
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
#' @export #' @export
#' @seealso \code{\link{readWQPdata}}, \code{\link{whatWQPsites}}, #' @seealso \code{\link{readWQPdata}}, \code{\link{whatWQPsites}},
#' \code{\link{readNWISqw}}, and \code{\link{importWQP}} #' \code{\link{readNWISqw}}, and \code{\link{importWQP}}
#' @examples #' @examplesIf is_dataRetrieval_user()
#' \donttest{ #' \donttest{
#' rawPcode <- readWQPqw('USGS-01594440','01075', '', '') #' rawPcode <- readWQPqw('USGS-01594440','01075', '', '')
#' rawCharacteristicName <- readWQPqw('WIDNR_WQX-10032762','Specific conductance', '', '') #' rawCharacteristicName <- readWQPqw('WIDNR_WQX-10032762','Specific conductance', '', '')
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
#' queryTime \tab POSIXct \tab The time the data was returned \cr #' queryTime \tab POSIXct \tab The time the data was returned \cr
#' } #' }
#' @export #' @export
#' @examples #' @examplesIf is_dataRetrieval_user()
#' \donttest{ #' \donttest{
#' #'
#' availableData <- whatNWISdata(siteNumber = '05114000') #' availableData <- whatNWISdata(siteNumber = '05114000')
......
...@@ -126,7 +126,7 @@ whatWQPmetrics <- function(...){ ...@@ -126,7 +126,7 @@ whatWQPmetrics <- function(...){
#' #'
#' @export #' @export
#' @seealso whatNWISsites #' @seealso whatNWISsites
#' @examples #' @examplesIf is_dataRetrieval_user()
#' \donttest{ #' \donttest{
#' site1 <- whatWQPdata(siteid="USGS-01594440") #' site1 <- whatWQPdata(siteid="USGS-01594440")
#' #'
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment