View source: R/frequency_analysis.R
daily_gwl_plot | R Documentation |
Calculates daily statistics based on all approved data. Daily, discrete, or both types are included. Historic median or mean are plotted based on all of the approved data.
daily_gwl_plot(
gw_level_dv,
gwl_data,
parameter_cd = NA,
date_col = NA,
value_col = NA,
approved_col = NA,
stat_cd = NA,
start_date = NA,
end_date = NA,
historical_stat = "mean",
month_breaks = FALSE,
plot_title = "",
subtitle = "U.S. Geological Survey",
y_axis_label = "",
flip = FALSE
)
gw_level_dv |
data frame, daily groundwater level data. Often obtained
from |
gwl_data |
data frame returned from |
parameter_cd |
If data in gw_level_dv comes from NWIS, the parameter_cd
can be used to define the value_col. If the data doesn't come directly from
NWIS services, this can be set to |
date_col |
the name of the date column. The default is |
value_col |
the name of the value column. The default is |
approved_col |
the name of the column to get provisional/approved status.
The default is |
stat_cd |
If data in gw_level_dv comes from NWIS, the stat_cd can be used to help define the value_col. |
start_date |
Date to start plot. If |
end_date |
Date to end plot. If |
historical_stat |
the summary statistic to use for middle line of the plot. Either "mean" or "median." |
month_breaks |
a logical indicating whether to use monthly breaks for the plot |
plot_title |
the title to use on the plot |
subtitle |
character. Sub-title for plot, default is "U.S. Geological Survey". |
y_axis_label |
the label to use for the y axis |
flip |
logical. If |
a ggplot object with a ribbon indicating the historical daily range, the historical daily mean or median, and approved and provisional daily data for the last two years
site <- "263819081585801"
p_code_dv <- "62610"
statCd <- "00001"
# gw_level_dv <- dataRetrieval::readNWISdv(site, p_code_dv, statCd = statCd)
gw_level_dv <- L2701_example_data$Daily
gwl_data <- L2701_example_data$Discrete
daily_gwl_plot(gw_level_dv,
NULL,
parameter_cd = "62610",
plot_title = "Groundwater Level",
historical_stat = "median")
daily_gwl_plot(gw_level_dv,
gwl_data,
parameter_cd = "62610",
plot_title = "Groundwater Level",
historical_stat = "median")
daily_gwl_plot(gw_level_dv,
gwl_data,
parameter_cd = "62610",
plot_title = "Groundwater Level",
month_breaks = TRUE,
start_date = "2020-10-01",
historical_stat = "median")
daily_gwl_plot(gw_level_dv, gwl_data,
parameter_cd = "62610",
plot_title = "Groundwater Level",
month_breaks = TRUE,
start_date = "2018-10-01",
end_date = "2020-10-01",
historical_stat = "median")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.