library(powstreams) library(dplyr) library(choroplethr) library(dataRetrieval) library(choroplethrMaps) data(state.regions) sites <- list_sites(with_timeseries = 'doobs') df <- state.regions[,c(1,3)] names(df)[2] <- 'value' df[,2] <- 0 nwis_sites <- mda.streams:::parse_site_name(sites) site_data <- readNWISsite(nwis_sites) for (i in 1:length(sites)){ region <- state.regions[as.numeric(site_data$state_cd[i])==state.regions[,3], 1] u.i = df[,1] == region if (sum(u.i) == 1){ df[u.i, 2]<- df[u.i, 2]+1 } } sites_w_either <- unique(c(list_sites(with_timeseries = c('doobs','wtr','disch')), list_sites(with_timeseries = c('doobs','wtr','stage')))) state_choropleth(df)
r length(list_sites(with_timeseries = 'doobs'))
r length(list_sites(with_timeseries = c('doobs','wtr','disch')))
r length(sites_w_either)
r length(list_sites(with_timeseries = c('doobs','nitrate')))
library(powstreams) site <- 'nwis_08446500' doobs <- load_timeseries(site, 'doobs') aug_do <- filter(doobs, months(DateTime)=="August" & strftime(DateTime,'%Y') == '2012')
plot(aug_do, ylab = 'DO (mg/L)')
plot(aug_do[400:750, ], type = 'o', ylab = 'DO (mg/L)', pch = 21, bg='white')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.