Skip to content
Snippets Groups Projects
readNWISdata.Rd 2.59 KiB
Newer Older
  • Learn to ignore specific revisions
  • % Generated by roxygen2 (4.0.2): do not edit by hand
    
    \name{getNWISData}
    \alias{getNWISData}
    
    Laura A DeCicco's avatar
    Laura A DeCicco committed
    \alias{readNWISdata}
    
    \title{General Data Import from NWIS}
    \usage{
    
    getNWISData(service = "dv", ...)
    
    
    Laura A DeCicco's avatar
    Laura A DeCicco committed
    readNWISdata(service = "dv", ...)
    
    Laura A DeCicco's avatar
    Laura A DeCicco committed
    \item{service}{string. Possible values are "iv" (for instantaneous), "dv" (for daily values), "gwlevels"
    (for groundwater levels), and "qwdata" (for water quality)}
    
    
    \item{\dots}{see \url{http://waterservices.usgs.gov/rest/Site-Service.html#Service} for a complete list of options}
    }
    \value{
    
    Laura A DeCicco's avatar
    Laura A DeCicco committed
    A data frame with the following columns:
    \tabular{lll}{
    Name \tab Type \tab Description \cr
    agency \tab character \tab The NWIS code for the agency reporting the data\cr
    site \tab character \tab The USGS site number \cr
    datetime \tab POSIXct \tab The date and time of the value converted to UTC (for unit value data), \cr
    \tab character \tab or raw character string \cr
    tz_cd \tab character \tab The time zone code for datetime \cr
    code \tab character \tab Any codes that qualify the corresponding value\cr
    value \tab numeric \tab The numeric value for the parameter \cr
    }
    Note that code and value are repeated for the parameters requested. The names are of the form
    X_D_P_S, where X is literal,
    D is an option description of the parameter,
    P is the parameter code,
    and S is the statistic code (if applicable).
    
    There are also several useful attributes attached to the data frame:
    
    Laura A DeCicco's avatar
    Laura A DeCicco committed
    \tabular{lll}{
    
    Laura A DeCicco's avatar
    Laura A DeCicco committed
    Name \tab Type \tab Description \cr
    url \tab character \tab The url used to generate the data \cr
    siteInfo \tab data.frame \tab A data frame containing information on the requested sites \cr
    variableInfo \tab data.frame \tab A data frame containing information on the requested parameters \cr
    statisticInfo \tab data.frame \tab A data frame containing information on the requested statistics on the data \cr
    queryTime \tab POSIXct \tab The time the data was returned \cr
    }
    
    }
    \description{
    Returns data from the NWIS web service.
    
    Laura A DeCicco's avatar
    Laura A DeCicco committed
    Arguments to the function should be based on \url{http://waterservices.usgs.gov} service calls.
    
    Laura A DeCicco's avatar
    Laura A DeCicco committed
    \dontrun{
    # Examples not run for time considerations
    
    Laura A DeCicco's avatar
    Laura A DeCicco committed
    dataTemp <- readNWISdata(stateCd="OH",parameterCd="00010")
    dataTempUnit <- readNWISdata(sites="03086500", service="iv", parameterCd="00010")
    
    Laura A DeCicco's avatar
    Laura A DeCicco committed
    #Empty:
    multiSite <- readNWISdata(sites=c("04025000","04072150"), service="iv", parameterCd="00010")
    #Not empty:
    multiSite <- readNWISdata(sites=c("04025500","040263491"), service="iv", parameterCd="00060")
    
    Laura A DeCicco's avatar
    Laura A DeCicco committed
    }
    
    Laura A DeCicco's avatar
    Laura A DeCicco committed
    \seealso{
    \code{\link{renameNWISColumns}},  \code{\link{importWaterML1}}, \code{\link{importRDB1}}
    }
    
    \keyword{NWIS}
    \keyword{data}
    \keyword{import}
    \keyword{service}
    \keyword{web}