Learn R Programming

ForestElementsR (version 2.0.1)

plot.fe_stand: Plot an fe_stand Object

Description

Diameter distributions in number of trees per ha, one diagrame by year of survey, tree cohort to be displayed can be filtered.

Usage

# S3 method for fe_stand
plot(x, tree_filter = TRUE, ...)

Value

A plot (ggplot2) of the diameter distribution

Arguments

x

an fe_stand object

tree_filter

A data-masking expression that applies to the data.frame x$trees. It must return a logical value, and is defined in terms of the variables in x$trees. In this function, it is used internally in order to define the cohort of trees which is to be evaluated by this function (within a call to dplyr::filter()). While many meaningful filterings are conceivable, distinctions between total stand, removal stand, and remaining stand are the most probable applications. Defaults to TRUE, i.e. all trees are included. See examples.

...

additional arguments, not used in plot.fe_stand

Details

The diagram(s) are made with ggplot2::geom_bar, the colours for the species, the number and width of the diameter bins correspond to the default settings in ggplot.

Examples

Run this code
# display scientific species names in all examples
old_opt <- getOption("fe_spec_lang") # store current user sertting
options(fe_spec_lang = "sci") # display scientific names

# mixed mountain forest - all trees
mm_forest_1_fe_stand_spatial |> plot()
# ... remaining trees only
mm_forest_1_fe_stand_spatial |> plot(tree_filter = !removal)
# ... removal only
mm_forest_1_fe_stand_spatial |> plot(tree_filter = removal)
# ... all trees with dbh > 30 cm
mm_forest_1_fe_stand_spatial |> plot(tree_filter = dbh_cm > 20)

# other example stands
selection_forest_1_fe_stand |> plot()
norway_spruce_1_fe_stand |> plot()
spruce_beech_1_fe_stand |> plot()

# reset to previous species name settings
options(fe_spec_lang = old_opt)

Run the code above in your browser using DataLab