Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Water
dataRetrieval
Commits
ee765ff1
Commit
ee765ff1
authored
Sep 10, 2021
by
Laura A DeCicco
Browse files
Trying the examplesIf
parent
87705271
Changes
22
Hide whitespace changes
Inline
Side-by-side
.github/workflows/pkgdown.yaml
View file @
ee765ff1
...
@@ -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}
DESCRIPTION
View file @
ee765ff1
...
@@ -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
NAMESPACE
View file @
ee765ff1
...
@@ -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)
...
...
R/AAA.R
View file @
ee765ff1
...
@@ -5,3 +5,14 @@ pkg.env <- new.env()
...
@@ -5,3 +5,14 @@ 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"
),
""
)
}
R/findNLDI.R
View file @
ee765ff1
...
@@ -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
#' @examples
If is_dataRetrieval_user()
#' \donttest{
#' \donttest{
#' # Find Features / Define origin features
#' # Find Features / Define origin features
#'
#'
...
...
R/getWebServiceData.R
View file @
ee765ff1
...
@@ -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
#' @examples
If is_dataRetrieval_user()
#' siteNumber <- "02177000"
#' siteNumber <- "02177000"
#' startDate <- "2012-09-01"
#' startDate <- "2012-09-01"
#' endDate <- "2012-10-01"
#' endDate <- "2012-10-01"
...
...
R/importRDB1.r
View file @
ee765ff1
...
@@ -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
#' @examples
If 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"
...
...
R/importWQP.R
View file @
ee765ff1
...
@@ -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
#' @examples
If 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:
...
...
R/importWaterML1.r
View file @
ee765ff1
...
@@ -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
#' @examples
If 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"
...
...
R/readNGWMNdata.R
View file @
ee765ff1
...
@@ -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
#' @examples
If is_dataRetrieval_user()
#' \donttest{
#' \donttest{
#' #one site
#' #one site
#' site <- "USGS.430427089284901"
#' site <- "USGS.430427089284901"
...
...
R/whatWQPdata.R
View file @
ee765ff1
...
@@ -126,7 +126,7 @@ whatWQPmetrics <- function(...){
...
@@ -126,7 +126,7 @@ whatWQPmetrics <- function(...){
#'
#'
#' @export
#' @export
#' @seealso whatNWISsites
#' @seealso whatNWISsites
#' @examples
#' @examples
If is_dataRetrieval_user()
#' \donttest{
#' \donttest{
#' site1 <- whatWQPdata(siteid="USGS-01594440")
#' site1 <- whatWQPdata(siteid="USGS-01594440")
#'
#'
...
...
README.md
View file @
ee765ff1
# dataRetrieval <img src="man/figures/logo.png" alt="dataRetrieval" height="150px" align="right" />
# dataRetrieval <img src="man/figures/logo.png" alt="dataRetrieval" height="150px" align="right" />
[

](https://github.com/USGS-R/dataRetrieval/actions)
[

](https://coveralls.io/github/USGS-R/dataRetrieval?branch=master)
[

](https://owi.usgs.gov/R/packages.html#core)
[

](https://cran.r-project.org/package=dataRetrieval)
[

](https://cran.r-project.org/package=dataRetrieval)
[

](https://cran.r-project.org/package=dataRetrieval)
Retrieval functions for USGS and EPA hydrologic and water quality data.
Retrieval functions for USGS and EPA hydrologic and water quality data.
For complete tutorial information, see:
For complete tutorial information, see:
...
...
_pkgdown.yml
View file @
ee765ff1
...
@@ -18,8 +18,6 @@ navbar:
...
@@ -18,8 +18,6 @@ navbar:
href
:
articles/movingAverages.html
href
:
articles/movingAverages.html
-
text
:
Stat Service
-
text
:
Stat Service
href
:
articles/statsServiceMap.html
href
:
articles/statsServiceMap.html
-
text
:
Earthquake Exploration
href
:
articles/earthquake.html
-
text
:
NLDI Interface
-
text
:
NLDI Interface
href
:
articles/nldi.html
href
:
articles/nldi.html
right
:
right
:
...
@@ -63,6 +61,15 @@ reference:
...
@@ -63,6 +61,15 @@ reference:
desc
:
Functions to interface with the NLDI.
desc
:
Functions to interface with the NLDI.
contents
:
contents
:
-
findNLDI
-
findNLDI
-
get_nldi_sources
-
title
:
Import data
desc
:
Functions to import different data formats
contents
:
-
importRDB1
-
importNGWMN
-
importWaterML1
-
importWaterML2
-
importWQP
-
title
:
Helper functions
-
title
:
Helper functions
contents
:
contents
:
-
calcWaterYear
-
calcWaterYear
...
@@ -71,4 +78,16 @@ reference:
...
@@ -71,4 +78,16 @@ reference:
-
setAccess
-
setAccess
-
countyCdLookup
-
countyCdLookup
-
stateCdLookup
-
stateCdLookup
-
countyCd
-
parameterCdFile
-
stateCd
-
zeroPad
-
zeroPad
-
dataRetrieval
-
title
:
Web query utilities
desc
:
Functions to create web queries
contents
:
-
constructNWISURL
-
constructUseURL
-
constructWQPURL
-
getQuerySummary
-
getWebServiceData
man/findNLDI.Rd
View file @
ee765ff1
...
@@ -65,6 +65,7 @@ navigated paths. Valid starting options can be given by one of the following
...
@@ -65,6 +65,7 @@ navigated paths. Valid starting options can be given by one of the following
arguments: comid, nwis, huc12, wqp, location, and start.
arguments: comid, nwis, huc12, wqp, location, and start.
}
}
\examples{
\examples{
\dontshow{if (is_dataRetrieval_user()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf}
\donttest{
\donttest{
# Find Features / Define origin features
# Find Features / Define origin features
...
@@ -106,5 +107,6 @@ arguments: comid, nwis, huc12, wqp, location, and start.
...
@@ -106,5 +107,6 @@ arguments: comid, nwis, huc12, wqp, location, and start.
## Limit search to 50 km
## Limit search to 50 km
findNLDI(comid = 101, nav = "DM", find = c("nwis", "wqp", "flowlines"), distance_km = 50)
findNLDI(comid = 101, nav = "DM", find = c("nwis", "wqp", "flowlines"), distance_km = 50)
}
}
\dontshow{\}) # examplesIf}
}
}
\keyword{nldi}
\keyword{nldi}
man/getWebServiceData.Rd
View file @
ee765ff1
...
@@ -19,6 +19,7 @@ This function accepts a url parameter, and returns the raw data. The function en
...
@@ -19,6 +19,7 @@ This function accepts a url parameter, and returns the raw data. The function en
\code{\link[httr]{GET}} with more informative error messages.
\code{\link[httr]{GET}} with more informative error messages.
}
}
\examples{
\examples{
\dontshow{if (is_dataRetrieval_user()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf}
siteNumber <- "02177000"
siteNumber <- "02177000"
startDate <- "2012-09-01"
startDate <- "2012-09-01"
endDate <- "2012-10-01"
endDate <- "2012-10-01"
...
@@ -28,4 +29,5 @@ obs_url <- constructNWISURL(siteNumber,property,startDate,endDate,'dv')
...
@@ -28,4 +29,5 @@ obs_url <- constructNWISURL(siteNumber,property,startDate,endDate,'dv')
\donttest{
\donttest{
rawData <- getWebServiceData(obs_url)
rawData <- getWebServiceData(obs_url)
}
}
\dontshow{\}) # examplesIf}
}
}
man/importRDB1.Rd
View file @
ee765ff1
...
@@ -55,6 +55,7 @@ NWIS site, parameter code, statistic, startdate and enddate. It is not
...
@@ -55,6 +55,7 @@ NWIS site, parameter code, statistic, startdate and enddate. It is not
recommended to use the RDB format for importing multi-site data.
recommended to use the RDB format for importing multi-site data.
}
}
\examples{
\examples{
\dontshow{if (is_dataRetrieval_user()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf}
site_id <- "02177000"
site_id <- "02177000"
startDate <- "2012-09-01"
startDate <- "2012-09-01"
endDate <- "2012-10-01"
endDate <- "2012-10-01"
...
@@ -97,5 +98,5 @@ filePath <- system.file("extdata", package="dataRetrieval")
...
@@ -97,5 +98,5 @@ filePath <- system.file("extdata", package="dataRetrieval")
fileName <- "RDB1Example.txt"
fileName <- "RDB1Example.txt"
fullPath <- file.path(filePath, fileName)
fullPath <- file.path(filePath, fileName)
importUserRDB <- importRDB1(fullPath)
importUserRDB <- importRDB1(fullPath)
\dontshow{\}) # examplesIf}
}
}
man/importWQP.Rd
View file @
ee765ff1
...
@@ -26,6 +26,7 @@ start and end times, and converted to UTC. See \url{https://www.waterqualitydata
...
@@ -26,6 +26,7 @@ start and end times, and converted to UTC. See \url{https://www.waterqualitydata
Imports data from the Water Quality Portal based on a specified url.
Imports data from the Water Quality Portal based on a specified url.
}
}
\examples{
\examples{
\dontshow{if (is_dataRetrieval_user()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf}
# 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:
...
@@ -42,7 +43,7 @@ STORETex <- constructWQPURL('WIDNR_WQX-10032762','Specific conductance', '', '')
...
@@ -42,7 +43,7 @@ STORETex <- constructWQPURL('WIDNR_WQX-10032762','Specific conductance', '', '')
STORETdata <- importWQP(STORETex)
STORETdata <- importWQP(STORETex)
}
}
\dontshow{\}) # examplesIf}
}
}
\seealso{
\seealso{
\code{\link{readWQPdata}}, \code{\link{readWQPqw}}, \code{\link{whatWQPsites}}
\code{\link{readWQPdata}}, \code{\link{readWQPqw}}, \code{\link{whatWQPsites}}
...
...
man/importWaterML1.Rd
View file @
ee765ff1
...
@@ -50,6 +50,7 @@ This function accepts a url parameter that already contains the desired
...
@@ -50,6 +50,7 @@ This function accepts a url parameter that already contains the desired
NWIS site, parameter code, statistic, startdate and enddate.
NWIS site, parameter code, statistic, startdate and enddate.
}
}
\examples{
\examples{
\dontshow{if (is_dataRetrieval_user()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf}
site_id <- "02177000"
site_id <- "02177000"
startDate <- "2012-09-01"
startDate <- "2012-09-01"
endDate <- "2012-10-01"
endDate <- "2012-10-01"
...
@@ -103,7 +104,7 @@ filePath <- system.file("extdata", package="dataRetrieval")
...
@@ -103,7 +104,7 @@ filePath <- system.file("extdata", package="dataRetrieval")
fileName <- "WaterML1Example.xml"
fileName <- "WaterML1Example.xml"
fullPath <- file.path(filePath, fileName)
fullPath <- file.path(filePath, fileName)
importFile <- importWaterML1(fullPath,TRUE)
importFile <- importWaterML1(fullPath,TRUE)
\dontshow{\}) # examplesIf}
}
}
\seealso{
\seealso{
\code{\link{renameNWISColumns}}
\code{\link{renameNWISColumns}}
...
...
man/is_dataRetrieval_user.Rd
0 → 100644
View file @
ee765ff1
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/AAA.R
\name{is_dataRetrieval_user}
\alias{is_dataRetrieval_user}
\title{Is this a dataRetrieval user}
\usage{
is_dataRetrieval_user()
}
\description{
Reveals if this is a user or not
}
\examples{
is_dataRetrieval_user()
}
man/readNGWMNdata.Rd
View file @
ee765ff1
...
@@ -25,6 +25,7 @@ for more information on time zones.}
...
@@ -25,6 +25,7 @@ for more information on time zones.}
Only water level data and site locations and names are currently available through the web service.
Only water level data and site locations and names are currently available through the web service.
}
}
\examples{
\examples{
\dontshow{if (is_dataRetrieval_user()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf}
\donttest{
\donttest{
#one site
#one site
site <- "USGS.430427089284901"
site <- "USGS.430427089284901"
...
@@ -52,5 +53,5 @@ noDataSite <- "UTGS.401544112060301"
...
@@ -52,5 +53,5 @@ noDataSite <- "UTGS.401544112060301"
#bboxData <- readNGWMNdata(service = "observation", siteNumbers = bboxSites$site[1:3],
#bboxData <- readNGWMNdata(service = "observation", siteNumbers = bboxSites$site[1:3],
#asDateTime = FALSE)
#asDateTime = FALSE)
}
}
\dontshow{\}) # examplesIf}
}
}
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment