plot_demograph: Create a ggplot2 object for plotting fhx-style demographics...

Description Usage Arguments Value

Description

Create a ggplot2 object for plotting fhx-style demographics on avalanche objects.

Usage

1
2
3
4
5
6
plot_demograph(x, color_group, color_id, facet_group, facet_id,
  facet_type = "grid", ylabels = TRUE, yearlims = FALSE,
  composite_rug = FALSE, filter_prop = 0.25, filter_min_rec = 2,
  filter_min_events = 1, injury_event = FALSE, plot_legend = FALSE,
  event_size = c(Scar = 4, Injury = 2, `Pith/Bark` = 1.5),
  rugbuffer_size = 2, rugdivide_pos = 2)

Arguments

x

An fhx instance.

color_group

Option to plot series with colors. This is a character vector or factor which corresponds to the series names given in color_id. Both color_group and color_id need to be specified. Default plot gives no color.

color_id

Option to plot series with colors. A character vector of series names corresponding to groups given in color_group. Every unique value in x series.names needs to have a corresponding color_group value. Both color_group and color_id need to be specified. Default plot gives no species colors.

facet_group

Option to plot series with faceted by a factor. A vector of factors or character vector which corresponds to the series names given in facet_id. Both facet_group and facet_id need to be specified. Default plot is not faceted.

facet_id

Option to plot series with faceted by a factor. A vector of series names corresponding to species names given in facet_group. Every unique values in x series.names needs to have a corresponding facet_group value. Both facet_group and facet_id need to be specified. Default plot is not faceted. Note that composite_rug and facet_group, facet_id cannot be used in the same plot. You must choose facets or a composite rug.

facet_type

Type of ggplot2 facet to use, if faceting. Must be either "grid" or "wrap". Default is "grid". Note that composite_rug and facet_group, facet_id cannot be used in the same plot. You must choose facets or a composite rug.

ylabels

Optional boolean to remove y-axis (series name) labels and tick marks. Default is TRUE.

yearlims

Option to limit the plot to a range of years. This is a vector with two integers. The first integer gives the lower year for the range while the second integer gives the upper year. The default is to plot the full range of data given by x.

composite_rug

A boolean option to plot a rug on the bottom of the plot. Default is FALSE. Note that composite_rug and facet_group, facet_id cannot be used in the same plot. You must choose facets or a composite rug.

filter_prop

An optional argument if the user chooses to include a composite rug in their plot. This is passed to composite. See this function for details.

filter_min_rec

An optional argument if the user chooses to include a composite rug in their plot. This is passed to composite. See this function for details.

filter_min_events

An optional argument if the user chooses to include a composite rug in their plot. This is passed to composite. See this function for details.

injury_event

Boolean indicating whether injuries should be considered recorders. This is passed to composite. See this function for details.

plot_legend

A boolean option allowing the user to choose whether a legend is included in the plot or not. Default is FALSE.

event_size

An optional numeric vector that adjusts the size of fire event symbols on the plot. Default is c("Scar" = 4, "Injury" = 2, "Pith/Bark" = 1.5).

rugbuffer_size

An optional integer. If the user plots a rug, this controls the amount of buffer whitespace along the y-axis between the rug and the main plot. Must be >= 2.

rugdivide_pos

Optional integer if plotting a rug. Adjust the placement of the rug divider along the y-axis. Default is 2.

Value

A ggplot object for plotting or manipulation.


chguiterman/slideRun documentation built on May 14, 2019, 5:13 a.m.