Skip to content
Snippets Groups Projects
Commit 7c9ad570 authored by Laura A DeCicco's avatar Laura A DeCicco
Browse files

Performed build with new getDataAvailablity function.

parent 342eecbd
No related branches found
No related tags found
No related merge requests found
......@@ -51,7 +51,7 @@ Collate:
'retrieveNWISqwData.r'
'processQWData.r'
'constructNWISURL.r'
'getSiteFileData.r'
'getDataAvailability.r'
Depends:
R (>= 2.15.0)
Imports:
......
......@@ -7,6 +7,7 @@ export(formatCheckDate)
export(formatCheckParameterCd)
export(formatCheckSiteNumber)
export(getDailyDataFromFile)
export(getDataAvailablilty)
export(getDataFromFile)
export(getDVData)
export(getMetaData)
......
#' USGS data availability
#'
#' Imports a table of available parameters, period of record, and count.
#' Imports a table of available parameters, period of record, and count. There is also an option to load the long parameter names and additional information on the parameters with longNames=TRUE.
#'
#' @param siteNumber string USGS site number. This is usually an 8 digit number
#' @param interactive logical Option for interactive mode. If true, there is user interaction for error handling and data checks.
#' @param longNames logical
#' @param longNames logical indicates whether or not to make a web call to get long names of parameters. Be aware this could take a very long time if the station has lots of data.
#' @keywords data import USGS web service
#' @return retval dataframe with all information found in the expanded site file
#' @export
#' @examples
#' # These examples require an internet connection to run
#' siteINFO <- getSiteFileData('05114000',interactive=FALSE)
getSiteFileData <- function(siteNumber="",interactive=TRUE){
#' availableData <- getDataAvailablilty('05114000',interactive=FALSE)
getDataAvailablilty <- function(siteNumber="",interactive=TRUE, longNames=FALSE){
# Checking for 8 digit site ID:
siteNumber <- formatCheckSiteNumber(siteNumber, longNames = FALSE,interactive=interactive)
siteNumber <- formatCheckSiteNumber(siteNumber,interactive=interactive)
urlSitefile <- paste("http://waterservices.usgs.gov/nwis/site?format=rdb&siteOutput=Expanded&sites=",siteNumber,sep = "")
urlSitefile <- paste("http://waterservices.usgs.gov/nwis/site?format=rdb&seriesCatalogOutput=true&sites=",siteNumber,sep = "")
SiteFile <- read.delim(
urlSitefile,
......
......@@ -28,8 +28,7 @@
quality portal, which can include STORET).}
}
\value{
data dataframe with agency, site, dateTime, value, and
code columns
url string
}
\description{
Imports data from NWIS web service. This function gets
......
\name{getDataAvailablilty}
\alias{getDataAvailablilty}
\title{USGS data availability}
\usage{
getDataAvailablilty(siteNumber = "", interactive = TRUE,
longNames = FALSE)
}
\arguments{
\item{siteNumber}{string USGS site number. This is
usually an 8 digit number}
\item{interactive}{logical Option for interactive mode.
If true, there is user interaction for error handling and
data checks.}
\item{longNames}{logical indicates whether or not to make
a web call to get long names of parameters. Be aware this
could take a very long time if the station has lots of
data.}
}
\value{
retval dataframe with all information found in the
expanded site file
}
\description{
Imports a table of available parameters, period of
record, and count. There is also an option to load the
long parameter names and additional information on the
parameters with longNames=TRUE.
}
\examples{
# These examples require an internet connection to run
availableData <- getDataAvailablilty('05114000',interactive=FALSE)
}
\keyword{data}
\keyword{import}
\keyword{service}
\keyword{USGS}
\keyword{web}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment