plot_flow_data_symbols {fasstr} | R Documentation |
Plot daily streamflow data with their symbols
Description
Plots data symbols for a daily data set. A column of symbols is required, default symbols = 'Symbol'
.
For HYDAT data, symbols include: 'E' Estimate, 'A' Partial Day, 'B' Ice Conditions, 'D' Dry, and 'R' Revised.
Other symbols or categories may be used to colour points of plot.
Returns a list of plots.
Usage
plot_flow_data_symbols(
data,
dates = Date,
values = Value,
groups = STATION_NUMBER,
symbols = Symbol,
station_number,
water_year_start = 1,
start_year,
end_year,
exclude_years,
months = 1:12,
start_date,
end_date,
log_discharge = FALSE,
include_title = FALSE
)
Arguments
data |
Data frame of daily data that contains columns of dates, flow values, and (optional) groups (e.g. station numbers).
Leave blank or set to |
dates |
Name of column in |
values |
Name of column in |
groups |
Name of column in |
symbols |
Name of column in |
station_number |
Character string vector of seven digit Water Survey of Canada station numbers (e.g. |
water_year_start |
Numeric value indicating the month ( |
start_year |
Numeric value of the first year to consider for analysis. Leave blank or set well before start date (i.e.
|
end_year |
Numeric value of the last year to consider for analysis. Leave blank or set well after end date (i.e.
|
exclude_years |
Numeric vector of years to exclude from analysis. Leave blank or set to |
months |
Numeric vector of months to include in plotting For example, |
start_date |
Date (YYYY-MM-DD) of first date to consider for plotting. Leave blank if all years are required. |
end_date |
Date (YYYY-MM-DD) of last date to consider for plotting. Leave blank if all years are required. |
log_discharge |
Logical value to indicate plotting the discharge axis (Y-axis) on a logarithmic scale. Default |
include_title |
Logical value to indicate adding the group/station number to the plot, if provided. Default |
Value
A list of ggplot2 objects with the following for each station provided:
Flow_Data_Symbols |
a plot that contains the flow data with symbol categories |
Examples
# Run if HYDAT database has been downloaded (using tidyhydat::download_hydat())
if (file.exists(tidyhydat::hy_downloaded_db())) {
# Plot data and symbols from a data frame and data argument
flow_data <- tidyhydat::hy_daily_flows(station_number = "08NM116")
plot_flow_data_symbols(data = flow_data)
# Plot data and symbols using station_number argument with defaults
plot_flow_data_symbols(station_number = "08NM116")
}