
Import Sample Data from the Water Quality Portal for WRTDS
Source:R/readWQPSample.R
readWQPSample.RdImports data from the Water Quality Portal, so it could be STORET, USGS, or USDA data. This function gets the data from: https://www.waterqualitydata.us For raw data, use readWQPdata. This function will retrieve the raw data, compress it (summing constituents), then converts it to the Sample dataframe structure. See chapter 7 of the EGRET user guide for more details.
Usage
readWQPSample(siteNumber, characteristicName, startDate = "", endDate = "",
verbose = TRUE, legacy = FALSE)Arguments
- siteNumber
character site number. If USGS, it should be in the form :'USGS-XXXXXXXXX...'
- characteristicName
character. Either a valid characteristic name, or a 5 digit USGS parameter code.
- startDate
character starting date for data retrieval in the form YYYY-MM-DD. Default is empty quotes "" which will retrieve the full period of record.
- endDate
character ending date for data retrieval in the form YYYY-MM-DD. Default is empty quotes "" which will retrieve the full period of record.
- verbose
logical specifying whether or not to display progress message
- legacy
logical specifying whether to use the "legacy" WQP services, or the new ones. Legacy works well for non-USGS sites. For USGS sites it is recommended to use the
readNWISSamplefunction. Default isFALSEto get the newest data.
Value
A data frame 'Sample' with the following columns:
| Name | Type | Description |
| Date | Date | Date |
| ConcLow | numeric | Lower limit of concentration |
| ConcHigh | numeric | Upper limit of concentration |
| Uncen | integer | Uncensored data (1=TRUE, 0=FALSE) |
| ConcAve | numeric | Average concentration |
| Julian | integer | Number of days since Jan. 1, 1850 |
| Month | integer | Month of the year [1-12] |
| Day | integer | Day of the year [1-366] |
| DecYear | numeric | Decimal year |
| MonthSeq | integer | Number of months since January 1, 1850 |
| SinDY | numeric | Sine of the DecYear |
| CosDY | numeric | Cosine of the DecYear |