Query the SDWIS database by a public water system ID (PSID), start and end date, and storet.

get_data(psid = NULL, storet = NULL, start_date = NULL, end_date = NULL)

Arguments

psid

The public water system ID to be queried.

storet

A single storet to return.

start_date

The starting date for queried results.

end_date

The end date for queried results.

Value

A data.table of storet results for the input PSID and date range.

Examples

d <- get_data("0105009") head(d)
#> PWSID SAMP_DATE SAMP_TIME LAB_NUM ANADATE INDATE #> 1: 105009 2015-03-24 1310 1644 3/25/2015 0:00:00 4/6/2015 0:00:00 #> 2: 105009 2015-03-24 1315 1675 3/25/2015 0:00:00 4/16/2015 0:00:00 #> 3: 105009 2015-03-24 1320 1675 4/1/2015 0:00:00 4/16/2015 0:00:00 #> 4: 105009 2015-06-03 1410 1644 6/4/2015 0:00:00 6/15/2015 0:00:00 #> 5: 105009 2015-06-03 1415 1675 6/11/2015 0:00:00 7/9/2015 0:00:00 #> 6: 105009 2015-06-08 900 1675 6/8/2015 0:00:00 4/29/2016 0:00:00 #> METHOD INBY SPECIAL STORE_NUM XMOD FINDING CHEMICAL AKA1 #> 1: A S 1032 NA 23.0 CHROMIUM, HEXAVALENT CHROMIUM VI #> 2: A S 71850 NA 22.0 NITRATE (AS NO3) <NA> #> 3: A S 1002 NA 8.1 ARSENIC AS #> 4: A S 1032 NA 12.0 CHROMIUM, HEXAVALENT CHROMIUM VI #> 5: A S 1002 NA 7.6 ARSENIC AS #> 6: E300.1 A S 71850 NA 19.0 NITRATE (AS NO3) <NA> #> AKA2 CLS RPT_CDE RPT_UNIT MCL NL TRIGGER_AM DLR PHG RPHL #> 1: CHROMIUM 6 T IO UG/L 0 0 10 1 0 0 #> 2: <NA> T NI MG/L 45 0 23 2 45 45 #> 3: <NA> T IO UG/L 10 0 5 2 0 0 #> 4: CHROMIUM 6 T IO UG/L 0 0 10 1 0 0 #> 5: <NA> T IO UG/L 10 0 5 2 0 0 #> 6: <NA> T NI MG/L 45 0 23 2 45 45 #> CHEM_SORT Water System Name Principal County Served #> 1: CHROMIUM, HEXAVALENT MOUNTAIN HOUSE SCHOOL ALAMEDA #> 2: NITRATE (AS NO3) MOUNTAIN HOUSE SCHOOL ALAMEDA #> 3: ARSENIC MOUNTAIN HOUSE SCHOOL ALAMEDA #> 4: CHROMIUM, HEXAVALENT MOUNTAIN HOUSE SCHOOL ALAMEDA #> 5: ARSENIC MOUNTAIN HOUSE SCHOOL ALAMEDA #> 6: NITRATE (AS NO3) MOUNTAIN HOUSE SCHOOL ALAMEDA #> Federal Water System Type -CODE Federal Water System Type #> 1: NTNC Non-Transient Non-Community #> 2: NTNC Non-Transient Non-Community #> 3: NTNC Non-Transient Non-Community #> 4: NTNC Non-Transient Non-Community #> 5: NTNC Non-Transient Non-Community #> 6: NTNC Non-Transient Non-Community #> State Water System Type -CODE State Water System Type #> 1: NTNC Non-Transient Non-Community #> 2: NTNC Non-Transient Non-Community #> 3: NTNC Non-Transient Non-Community #> 4: NTNC Non-Transient Non-Community #> 5: NTNC Non-Transient Non-Community #> 6: NTNC Non-Transient Non-Community #> Water System Status -CODE Water System Status Owner Type -CODE Owner Type #> 1: A ACTIVE L Local #> 2: A ACTIVE L Local #> 3: A ACTIVE L Local #> 4: A ACTIVE L Local #> 5: A ACTIVE L Local #> 6: A ACTIVE L Local #> Primary Water Source Type -CODE Primary Water Source Type #> 1: GWP Groundwater Purchased #> 2: GWP Groundwater Purchased #> 3: GWP Groundwater Purchased #> 4: GWP Groundwater Purchased #> 5: GWP Groundwater Purchased #> 6: GWP Groundwater Purchased #> Residential Population Non Transient Population Transient Population #> 1: NA 50 NA #> 2: NA 50 NA #> 3: NA 50 NA #> 4: NA 50 NA #> 5: NA 50 NA #> 6: NA 50 NA #> Total Population Number of Service Connections Agricultural #> 1: 50 NA #> 2: 50 NA #> 3: 50 NA #> 4: 50 NA #> 5: 50 NA #> 6: 50 NA #> Number of COMBINED Service Connections (CB) #> 1: 1 #> 2: 1 #> 3: 1 #> 4: 1 #> 5: 1 #> 6: 1 #> Number of Commercial (CM) Service Connections #> 1: NA #> 2: NA #> 3: NA #> 4: NA #> 5: NA #> 6: NA #> Numer of Institutional Service Conections #> 1: NA #> 2: NA #> 3: NA #> 4: NA #> 5: NA #> 6: NA #> Number of Residential Service Connections #> 1: NA #> 2: NA #> 3: NA #> 4: NA #> 5: NA #> 6: NA #> Total Number of Service Connections Fee Code #> 1: 1 SP #> 2: 1 SP #> 3: 1 SP #> 4: 1 SP #> 5: 1 SP #> 6: 1 SP #> Fee Code Description #> 1: NonTransient-NonCommunity Water System #> 2: NonTransient-NonCommunity Water System #> 3: NonTransient-NonCommunity Water System #> 4: NonTransient-NonCommunity Water System #> 5: NonTransient-NonCommunity Water System #> 6: NonTransient-NonCommunity Water System #> Date of Sanitary Survey visit (SNSV Visit Date) CITY #> 1: 1/24/2012 BYRON #> 2: 1/24/2012 BYRON #> 3: 1/24/2012 BYRON #> 4: 1/24/2012 BYRON #> 5: 1/24/2012 BYRON #> 6: 1/24/2012 BYRON #> Treatment Plant Class-CODE Treatment Plant Class #> 1: NA NA #> 2: NA NA #> 3: NA NA #> 4: NA NA #> 5: NA NA #> 6: NA NA #> Distribution System Class-CODE Distribution System Class #> 1: D1 Distribution Operator Level 1 #> 2: D1 Distribution Operator Level 1 #> 3: D1 Distribution Operator Level 1 #> 4: D1 Distribution Operator Level 1 #> 5: D1 Distribution Operator Level 1 #> 6: D1 Distribution Operator Level 1
# Alameda Country Water District (psid = 110001) # nitrate data (storet = A-029) d <- get_data( psid = "0110001", storet = "A-029") ggplot(d, aes(SAMP_DATE, FINDING)) + geom_point() + geom_smooth()
#> Error in ggplot(d, aes(SAMP_DATE, FINDING)): could not find function "ggplot"