readWQPdata: General Data Import from Water Quality Portal

Description Usage Arguments Value Examples

View source: R/readWQPdata.R

Description

Imports data from Water Quality Portal web service. This function gets the data from here: https://www.waterqualitydata.us. because it allows for other agencies rather than the USGS.

Usage

1
readWQPdata(..., querySummary = FALSE, tz = "UTC")

Arguments

...

see https://www.waterqualitydata.us/webservices_documentation for a complete list of options. A list of arguments can also be supplied.

querySummary

logical to ONLY return the number of records and unique sites that will be returned from this query. This argument is not supported via the combined list from the ... argument

tz

character to set timezone attribute of dateTime. Default is "UTC", and converts the date times to UTC, properly accounting for daylight savings times based on the data's provided tz_cd column. Possible values to provide are "America/New_York","America/Chicago", "America/Denver","America/Los_Angeles", "America/Anchorage", as well as the following which do not use daylight savings time: "America/Honolulu", "America/Jamaica","America/Managua","America/Phoenix", and "America/Metlakatla". See also OlsonNames() for more information on time zones.

Value

A data frame with at least the following columns:

Name Type Description
OrganizationIdentifier character A designator used to uniquely identify a unique business establishment within a context.
OrganizationFormalName character The legal designator (i.e. formal name) of an organization.
ActivityIdentifier character Designator that uniquely identifies an activity within an organization.
ActivityTypeCode character The text describing the type of activity.
ActivityMediaName character Name or code indicating the environmental medium where the sample was taken.
ActivityMediaSubdivisionName character Name or code indicating the environmental matrix as a subdivision of the sample media.
ActivityStartDate character The calendar date on which the field activity is started.
ActivityStartTime/Time character The time of day that is reported when the field activity began, based on a 24-hour timescale.
ActivityStartTime/TimeZoneCode character The time zone for which the time of day is reported. Any of the longitudinal divisions of the earth's surface in which a standard time is kept.
ActivityEndDate character The calendar date when the field activity is completed.
ActivityEndTime/Time character The time of day that is reported when the field activity ended, based on a 24-hour timescale.
ActivityEndTime/TimeZoneCode character The time zone for which the time of day is reported. Any of the longitudinal divisions of the earth's surface in which a standard time is kept.
ActivityDepthHeightMeasure/MeasureValue character A measurement of the vertical location (measured from a reference point) at which an activity occurred. Measure value is given in the units stored in ActivityDepthHeightMeasure/MeasureUnitCode.
ActivityDepthHeightMeasure/MeasureUnitCode character The code that represents the unit for measuring the item.
ActivityDepthAltitudeReferencePointText character The reference used to indicate the datum or reference used to establish the depth/altitude of an activity.
ActivityTopDepthHeightMeasure/MeasureValue character A measurement of the upper vertical location of a vertical location range (measured from a reference point) at which an activity occurred. Measure value is given in the units stored in ActivityTopDepthHeightMeasure/MeasureUnitCode.
ActivityTopDepthHeightMeasure/MeasureUnitCode character The code that represents the unit for measuring the item.
ActivityBottomDepthHeightMeasure/MeasureValue character A measurement of the lower vertical location of a vertical location range (measured from a reference point) at which an activity occurred. Measure value is given in the units stored in ActivityBottomDepthHeightMeasure/MeasureUnitCode.
ActivityBottomDepthHeightMeasure/MeasureUnitCode character The code that represents the unit for measuring the item.
ProjectIdentifier character A designator used to uniquely identify a data collection project within a context of an organization.
ActivityConductingOrganizationText character A name of the Organization conducting an activity.
MonitoringLocationIdentifier character A designator used to describe the unique name, number, or code assigned to identify the monitoring location.
ActivityCommentText character General comments concerning the activity.
SampleAquifer * character A code that designates the aquifer associated with groundwater samples.
HydrologicCondition * character Hydrologic condition is the hydrologic condition that is represented by the sample collected (i.e. ? normal, falling, rising, peak stage).
HydrologicEvent * character A hydrologic event that is represented by the sample collected (i.e. - storm, drought, snowmelt).
SampleCollectionMethod/MethodIdentifier character The identification number or code assigned by the method publisher.
SampleCollectionMethod/MethodIdentifierContext character Identifies the source or data system that created or defined the identifier.
SampleCollectionMethod/MethodName character The title that appears on the method from the method publisher.
SampleCollectionEquipmentName character The name for the equipment used in collecting the sample.
ResultDetectionConditionText character The textual descriptor of a result.
CharacteristicName character The object, property, or substance which is evaluated or enumerated by either a direct field measurement, a direct field observation, or by laboratory analysis of material collected in the field.
ResultSampleFractionText character The text name of the portion of the sample associated with results obtained from a physically-partitioned sample.
ResultMeasureValue numeric The reportable measure of the result for the chemical, microbiological or other characteristic being analyzed. Measure value is given in the units stored in ResultMeasure/MeasureUnitCode.
MeasureQualifierCode character A code used to identify any qualifying issues that affect the results.
ResultMeasure/MeasureUnitCode character The code that represents the unit for measuring the item.
ResultStatusIdentifier character Indicates the acceptability of the result with respect to QA/QC criteria.
StatisticalBaseCode character The code for the method used to calculate derived results.
ResultValueTypeName character A name that qualifies the process which was used in the determination of the result value (e.g., actual, estimated, calculated).
ResultWeightBasisText character The name that represents the form of the sample or portion of the sample which is associated with the result value (e.g., wet weight, dry weight, ash-free dry weight).
ResultTimeBasisText character The period of time (in days) over which a measurement was made. For example, BOD can be measured as 5 day or 20 day BOD.
ResultTemperatureBasisText character The name that represents the controlled temperature at which the sample was maintained during analysis, e.g. 25 deg BOD analysis.
ResultParticleSizeBasisText character User defined free text describing the particle size class for which the associated result is defined.
PrecisionValue character A measure of mutual agreement among individual measurements of the same property usually under prescribed similar conditions.
ResultCommentText character Free text with general comments concerning the result.
USGSPCode * character 5-digit number used in the US Geological Survey computerized data system, National Water Information System (NWIS), to uniquely identify a specific constituent.
ResultDepthHeightMeasure/MeasureValue + character A measurement of the vertical location (measured from a reference point) at which a result occurred.
ResultDepthHeightMeasure/MeasureUnitCode + character The code that represents the unit for measuring the item.
ResultDepthAltitudeReferencePointText + character The reference used to indicate the datum or reference used to establish the depth/altitude of a result.
SubjectTaxonomicName character The name of the organism from which a tissue sample was taken.
SampleTissueAnatomyName * character The name of the anatomy from which a tissue sample was taken.
ResultAnalyticalMethod/MethodIdentifier character The identification number or code assigned by the method publisher.
ResultAnalyticalMethod/MethodIdentifierContext character Identifies the source or data system that created or defined the identifier.
ResultAnalyticalMethod/MethodName character The title that appears on the method from the method publisher.
MethodDescriptionText * character A brief summary that provides general information about the method.
LaboratoryName character The name of Lab responsible for the result.
AnalysisStartDate character The calendar date on which the analysis began.
ResultLaboratoryCommentText character Remarks which further describe the laboratory procedures which produced the result.
DetectionQuantitationLimitTypeName character Text describing the type of detection or quantitation level used in the analysis of a characteristic.
DetectionQuantitationLimitMeasure/MeasureValue numeric Constituent concentration that, when processed through the complete method, produces a signal that is statistically different from a blank. Measure value is given in the units stored in DetectionQuantitationLimitMeasure/MeasureUnitCode.
DetectionQuantitationLimitMeasure/MeasureUnitCode character The code that represents the unit for measuring the item.
PreparationStartDate character The calendar date when the preparation/extraction of the sample for analysis began.
ActivityStartDateTime POSIXct Activity start date and time converted to POSIXct UTC.
ActivityEndDateTime POSIXct Activity end date and time converted to POSIXct UTC.

* = elements only in NWIS + = elements only in STORET

There are also several useful attributes attached to the data frame:

Name Type Description
url character The url used to generate the data
siteInfo data.frame A data frame containing information on the requested sites
variableInfo data.frame A data frame containing information on the requested parameters
queryTime POSIXct The time the data was returned

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
## Not run: 
nameToUse <- "pH"
pHData <- readWQPdata(siteid="USGS-04024315",characteristicName=nameToUse)
pHData_summary <- readWQPdata(bBox=c(-90.10,42.67,-88.64,43.35),
     characteristicName=nameToUse, querySummary=TRUE)
startDate <- as.Date("2013-01-01")
nutrientDaneCounty <- readWQPdata(countycode="US:55:025",startDate=startDate,
                        characteristicType="Nutrient")
secchi.names = c("Depth, Secchi disk depth", 
                 "Depth, Secchi disk depth (choice list)", 
                 "Secchi Reading Condition (choice list)", 
                 "Secchi depth", 
                 "Water transparency, Secchi disc")
args <- list('startDateLo' = startDate, 
             'startDateHi' = "2013-12-31", 
              statecode="WI", 
              characteristicName=secchi.names)

wqp.data <- readWQPdata(args)   

args_2 <- list('startDateLo' = startDate, 
             'startDateHi' = "2013-12-31", 
              statecode="WI", 
              characteristicName=secchi.names,
              querySummary=TRUE)

wqp.summary <- readWQPdata(args_2) 

arg_3 <- list('startDateLo' = startDate, 
             'startDateHi' = "2013-12-31")
arg_4 <- list(statecode="WI", 
              characteristicName=secchi.names)
wqp.summary <- readWQPdata(arg_3, arg_4, querySummary=TRUE)
wqp.summary_WI <- readWQPdata(arg_3, statecode="WI", 
                              characteristicName=secchi.names, 
                              querySummary=TRUE)
                              
# querying by county
dailyLexingtonVA <- readWQPdata(statecode = "Virginia", 
                                countycode="Lexington", 
                                parameterCd = "00010") 
                                
# Biological data:
bioData <- readWQPdata(statecode = "WI",
                       countycode = "Dane",
                       providers = "BIODATA")
                                

## End(Not run)

dataRetrieval documentation built on Sept. 28, 2017, 5:04 p.m.