View source: R/xs_metric_plot.R
xs_metric_plot | R Documentation |
Produces a longitudinal plot of cross section metrics for the input stream reach.
xs_metric_plot(
metric,
reach_xs_dims,
label_xs = TRUE,
xs_label_freq = 10,
profile_units = "kilometers"
)
metric |
FluvialGeomorphicMetric object; the fluvial geomorphic metric to be mapped |
reach_xs_dims |
data frame; a data frame of cross section dimensions. |
label_xs |
logical; Draw the cross section locations? |
xs_label_freq |
numeric; An integer indicating the frequency of cross section labels. |
profile_units |
character; the units of the longitudinal profile. One of "kilometers", "meters", "miles", or "feet" |
A ggplot2 object.
The xs_metrics_plot
function requires a xs_dimensions
dataframe. See the sin_xs_dimensions
package dataset for an
example of this format of cross section data produced by the
FluvialGeomorph
ArcGIS toolbox.
# Get feature class test data
xs_planform_fc <- file.path(system.file("extdata", "testing_data.gdb",
package = "fluvgeo"),
"feature_dataset/riffle_floodplain_dims_L3")
# Convert feature classes to an sf objects
xs_planform_sf <- fluvgeo::fc2sf(xs_planform_fc)
# Create the fluvgeo::FluvialGeomorphicMetric object
wdr <- new(Class = "FluvialGeomorphicMetric",
metric = "Width Depth Ratio",
definition = "bankfull width / bankfull depth",
variable = "xs_width_depth_ratio",
threshold_breaks = c(0, 10, 20, Inf),
threshold_labels = c("Incised",
"Stable",
"Overwidened"),
source = "Dunn & Leopold, 1978")
metric_plot <- fluvgeo::xs_metric_plot(metric = wdr,
reach_xs_dims = xs_planform_sf,
label_xs = TRUE,
profile_units = "miles")
print(metric_plot)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.