View source: R/frequency_analysis.R
weekly_frequency_plot | R Documentation |
Weekly statistics are calculated using the weekly_frequency_table
function.
Daily, discrete, or both types of data can be used.
weekly_frequency_plot(
gw_level_dv,
gwl_data,
parameter_cd = NA,
date_col = NA,
value_col = NA,
approved_col = NA,
stat_cd = NA,
plot_range = "Past year",
plot_title = "",
subtitle = "U.S. Geological Survey",
y_axis_label = "",
flip = FALSE,
percentile_colors = NA
)
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. |
plot_range |
the time frame to use for the plot. Either "Past year" to use the last year of data, or "Calendar year" to use the current calendar year, beginning in January. |
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 used for the y-axis of the plot. |
flip |
logical. If |
percentile_colors |
Optional argument to provide a vector of 5 colors used to fill the percentile bars in order from lowest percentile bin to the highest percentile bin. Default behavior (NA) is to use legacy plot colors. |
a ggplot object with rectangles representing the historical weekly percentiles, and points representing the historical median and daily values
# 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
weekly_frequency_plot(gw_level_dv,
gwl_data = NULL,
date_col = "Date",
value_col = "X_62610_00001",
approved_col = "X_62610_00001_cd")
gwl_data <- L2701_example_data$Discrete
weekly_frequency_plot(gw_level_dv,
gwl_data = gwl_data,
parameter_cd = "62610")
weekly_frequency_plot(gw_level_dv,
gwl_data = gwl_data,
parameter_cd = "62610",
flip = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.