Skip to content
Snippets Groups Projects
README.md 5.33 KiB
Newer Older
`dataRetrieval`
Laura A DeCicco's avatar
Laura A DeCicco committed
=============
Linux: [![travis](https://travis-ci.org/USGS-R/dataRetrieval.svg?branch=master)](https://travis-ci.org/USGS-R/dataRetrieval)
Laura A DeCicco's avatar
Laura A DeCicco committed

Laura A DeCicco's avatar
Laura A DeCicco committed
Windows: [![Build status](https://ci.appveyor.com/api/projects/status/msanha92b500grr7?svg=true)](https://ci.appveyor.com/project/ldecicco-USGS/dataretrieval-787)
Laura A DeCicco's avatar
Laura A DeCicco committed

Laura A DeCicco's avatar
Laura A DeCicco committed
Retrieval functions for USGS and EPA hydrologic and water quality data.
Laura A DeCicco's avatar
Laura A DeCicco committed

A fairly large overhaul of the functions was done on November 31, 2014. Feedback from initial users was incorporated. For questions, bug reports, and suggestions please create an Issue here:

[dataRetrieval Issues page](https://github.com/USGS-R/dataRetrieval/issues)
Laura A DeCicco's avatar
Laura A DeCicco committed
## Function Overview

Web service retrieval functions:
Laura A DeCicco's avatar
Laura A DeCicco committed

|Function | Inputs | Description | 
Laura A DeCicco's avatar
Laura A DeCicco committed
| -------------| ------------------------|:-------------|
|`readNWISdata` | `...`, `service` | NWIS data using user-specified queries |
|`readNWISdv` | `Common 3`, `parameterCd`, `statCd` | NWIS daily data with `Common` query |
|`readNWISqw` | `Common 3`, `parameterCd`, `expanded` | NWIS water quality data with `Common` query |
|`readNWISuv` | `Common 3`, `parameterCd` | NWIS instantaneous data with `Common` query |
|`readNWISpCode` | `parameterCd` | NWIS parameter code information |
Laura A DeCicco's avatar
Laura A DeCicco committed
|`readNWISgwl` | `Common 3` | NWIS groundwater level data with `Common` query |
|`readNWISpeak` | `Common 3` | NWIS peak flow data with `Common` query |
|`readNWISmeas` | `Common 3` | NWIS surface-water measurement data with `Common` query |
Laura A DeCicco's avatar
Laura A DeCicco committed
|`readNWISrating` | `siteNumber`, `type` | NWIS rating table for an active USGS streamgage |
|`readNWISsite` | `siteNumber` | NWIS site information |
Laura A DeCicco's avatar
Laura A DeCicco committed
|`whatNWISsites` | `...` | NWIS site search using user-specified queries |
Laura A DeCicco's avatar
Laura A DeCicco committed
|`whatNWISdata` | `siteNumber`, `service` | NWIS data availability, including period of record and count |
Laura A DeCicco's avatar
Laura A DeCicco committed
|`readWQPdata` | `...` | WQP data using user-specified queries |
|`readWQPqw` | `Common 3` | WQP data with `Common 3` query and either parameter code or characteristic name|
Laura A DeCicco's avatar
Laura A DeCicco committed
|`whatWQPsites` | `...` | WQP site search using user-specified queries |

Laura A DeCicco's avatar
Laura A DeCicco committed
* `Common 3` = siteNumber, startDate, endDate
Laura A DeCicco's avatar
Laura A DeCicco committed

Laura A DeCicco's avatar
Laura A DeCicco committed

Please consider reporting bugs and asking questions on the Issues page:
Laura A DeCicco's avatar
Laura A DeCicco committed

[https://github.com/USGS-R/dataRetrieval/issues](https://github.com/USGS-R/dataRetrieval/issues)
Laura A DeCicco's avatar
Laura A DeCicco committed

Laura A DeCicco's avatar
Laura A DeCicco committed

##Subscribe
Laura A DeCicco's avatar
Laura A DeCicco committed
Please email questions, comments, and feedback to: 
egret_comments@usgs.gov

Additionally, to subscribe to an email list concerning updates to these R packages, please send a request to egret_comments@usgs.gov.

##Package Installation
To install the dataRetrieval package, you must be using R 3.0 or greater and run the following command:
Laura A DeCicco's avatar
Laura A DeCicco committed
```R
	install.packages("dataRetrieval")
```
Laura A DeCicco's avatar
Laura A DeCicco committed

##Version updates
Laura A DeCicco's avatar
Laura A DeCicco committed
---------------
Laura A DeCicco's avatar
Laura A DeCicco committed

Laura A DeCicco's avatar
Laura A DeCicco committed
###dataRetrieval 2.0.0
Laura A DeCicco's avatar
Laura A DeCicco committed

* Changing naming convention. Migrated `EGRET` specific retrievals to `EGRET`:

Moving `EGRET` specific functions to `EGRET` (version 2.0.0 and greater):


|Information Source | Meta Data | Data |
| -------------| -------------| ------------- |:-------------|
|NWIS | `readNWISInfo` | `readNWISSample` |
|  |  | `readNWISDaily` |
| Water Quality Portal  | `readWQPInfo`| `readWQPSample` |
| User-supplied files | `readUserInfo` | `readUserDaily`|
| | | `readUserSample` |

Laura A DeCicco's avatar
Laura A DeCicco committed
* Added back WaterML2 parsing tool
* Added specific groundwater, rating, peak, and surfacewater measurement functions
Laura A DeCicco's avatar
Laura A DeCicco committed
* Attached metadata attributes to returned dataframes
###dataRetrieval 1.4.0
Laura A DeCicco's avatar
Laura A DeCicco committed
* Changed naming convention:

Laura A DeCicco's avatar
Laura A DeCicco committed

###dataRetrieval 1.3.3
Laura A DeCicco's avatar
Laura A DeCicco committed

Laura A DeCicco's avatar
Laura A DeCicco committed
* Updated getNWISSiteInfo to retrieve multiple site file datasets at once using a vector of siteNumbers as input argument.
* Updated error-handling for Web service calls. More information is returned when errors happen
* Added some basic processing to Water Quality Portal raw data retrievals. Date columns are returned as Date objects, value columns are numeric, and a column is created from the date/time/timezone columns that is POSIXct.
Laura A DeCicco's avatar
Laura A DeCicco committed
* Added very generalized NWIS and WQP retrieval functions (getNWISData, getNWISSites, getGeneralWQPData, and whatWQPsites) which allow the user to use any argument available on the Web service platform.
Laura A DeCicco's avatar
Laura A DeCicco committed

###dataRetrieval 1.3.2
Laura A DeCicco's avatar
Laura A DeCicco committed

Laura A DeCicco's avatar
Laura A DeCicco committed
* Deprecated getQWData, updated readWQPdata to take either parameter code or characteristic name.
* Changed the name of raw data retrievals to: readNWISqw, getNWISunitData, getNWISdvData, and getWQPqwData (from: readNWISqw, retrieveUnitNWISData, retrieveNWISData, getRawQWData)
Laura A DeCicco's avatar
Laura A DeCicco committed
* Added NA warning to getDVData function
* Updated mergeReport to allow for Sample data with different measurements taken on the same day
Laura A DeCicco's avatar
Laura A DeCicco committed

##Disclaimer
This software is in the public domain because it contains materials that originally came from the U.S. Geological Survey, an agency of the United States Department of Interior. For more information, see the [official USGS copyright policy](http://www.usgs.gov/visual-id/credit_usgs.html#copyright/ "official USGS copyright policy")

Although this software program has been used by the U.S. Geological Survey (USGS), no warranty, expressed or implied, is made by the USGS or the U.S. Government as to the accuracy and functioning of the program and related program material nor shall the fact of distribution constitute any such warranty, and no responsibility is assumed by the USGS in connection therewith.

This software is provided "AS IS."
Laura A DeCicco's avatar
Laura A DeCicco committed

 [
    ![CC0](http://i.creativecommons.org/p/zero/1.0/88x31.png)
  ](http://creativecommons.org/publicdomain/zero/1.0/)