View source: R/gwl_single_sites.R
gwl_plot_field | R Documentation |
Function to create the field groundwater level data plot.
gwl_plot_field(
gwl_data,
plot_title = "",
parameter_cd = NA,
date_col = "lev_dt",
value_col = NA,
approved_col = "lev_age_cd",
flip = TRUE,
y_label = "",
subtitle = "U.S. Geological Survey"
)
gwl_plot_all(
gw_level_dv,
gwl_data,
parameter_cd = NA,
date_col = NA,
value_col = NA,
approved_col = NA,
stat_cd = NA,
y_label = "",
subtitle = "U.S. Geological Survey",
plot_title = "",
add_trend = FALSE,
n_years = 10,
POR_trend = TRUE,
flip = FALSE,
days_required_per_month = 14
)
gwl_data |
data frame returned from |
plot_title |
character, title for plot. |
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 |
flip |
logical. If |
y_label |
character for y-axis label. Consider using |
subtitle |
character. Sub-title for plot, default is "U.S. Geological Survey". |
gw_level_dv |
data frame, daily groundwater level data. Often obtained
from |
stat_cd |
If data in gw_level_dv comes from NWIS, the stat_cd can be used to help define the value_col. |
add_trend |
logical. Uses |
n_years |
integer. This is the number of years to calculate the trend on. Default is 10. This can be a vector of years. |
POR_trend |
a logical indicating whether to include a trend test
for the full period of record. Default is |
days_required_per_month |
integer. Number of days required per month.
Default is 14. Only used if add_trend is |
# site <- "263819081585801"
# gwl_data <- dataRetrieval::readNWISgwl(site)
# Using package example data:
gwl_data <- L2701_example_data$Discrete
plot_title <- attr(gwl_data, "siteInfo")[["station_nm"]]
pcodes <- dataRetrieval::readNWISpCode(unique(gwl_data$parameter_cd))
gwl_plot_field(gwl_data,
plot_title = plot_title,
parameter_cd = "62610",
flip = FALSE,
y_label = pcodes$parameter_nm[pcodes$parameter_cd == "62610"])
gwl_plot_field(gwl_data,
plot_title = plot_title,
y_label = pcodes$parameter_nm[pcodes$parameter_cd == "62611"],
parameter_cd = "62611",
flip = FALSE)
gwl_plot_field(gwl_data,
plot_title = plot_title,
y_label = pcodes$parameter_nm[pcodes$parameter_cd == "72019"],
parameter_cd = "72019",
flip = TRUE)
# site <- "263819081585801"
parameterCd <- "62610"
# statCd <- "00001"
# gw_level_dv <- dataRetrieval::readNWISdv(site, parameterCd, statCd = statCd)
# Using package example data:
gw_level_dv <- L2701_example_data$Daily
gwl_data <- L2701_example_data$Discrete
plot_title <- attr(gwl_data, "siteInfo")[["station_nm"]]
pcodes <- dataRetrieval::readNWISpCode(unique(gwl_data$parameter_cd))
gwl_plot_all(gw_level_dv,
NULL,
parameter_cd = "62610",
plot_title = plot_title,
y_label = pcodes$parameter_nm[pcodes$parameter_cd == "62610"],
flip = TRUE)
gwl_plot_all(gw_level_dv,
gwl_data,
parameter_cd = "62610",
plot_title = plot_title,
y_label = pcodes$parameter_nm[pcodes$parameter_cd == "62610"],
add_trend = TRUE,
flip = FALSE)
gwl_plot_all(gw_level_dv,
gwl_data,
parameter_cd = "62610",
n_years = c(5, 10, 20),
POR_trend = TRUE,
y_label = pcodes$parameter_nm[pcodes$parameter_cd == "62610"],
plot_title = plot_title,
add_trend = TRUE)
gwl_plot_all(NULL,
gwl_data,
parameter_cd = "62610",
plot_title = plot_title,
y_label = pcodes$parameter_nm[pcodes$parameter_cd == "62610"])
gwl_plot_all(NULL,
gwl_data,
parameter_cd = "62610",
plot_title = plot_title,
y_label = pcodes$parameter_nm[pcodes$parameter_cd == "62610"],
add_trend = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.