display_recruitment: Display Mortality Rates with ggplot2

Description Usage Arguments Value

View source: R/display_recruitment.R View source: R/display_mortality.R

Description

Display Mortality Rates with ggplot2

Display recruitment Rates with ggplot2

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
display_recruitment(recruitment = NULL, type = "line",
  time_col = "time", color_col = "plot", faceting = FALSE,
  title = "Annual recruitment and recruitment rates in function of census intervals.",
  subtitle = NULL, save_graph = FALSE, device = "png",
  path_save = file.path("ForestGraphs",
  paste0("annual_recruitment_recruitment_", type, ".png")),
  name = "Annual recruitment and Recruitment rates for each between-census interval",
  create_folder = FALSE, overwrite = FALSE, ...)

display_recruitment(recruitment = NULL, type = "line",
  time_col = "time", color_col = "plot", faceting = FALSE,
  title = "Annual recruitment and recruitment rates in function of census intervals.",
  subtitle = NULL, save_graph = FALSE, device = "png",
  path_save = file.path("ForestGraphs",
  paste0("annual_recruitment_recruitment_", type, ".png")),
  name = "Annual recruitment and Recruitment rates for each between-census interval",
  create_folder = FALSE, overwrite = FALSE, ...)

Arguments

recruitment

data.frame, output of compute_recruitment

type

character, partially matching one of the following: "line", "histogram", "bar", "smooth". For the moment, only "line" is implemented, being the most relevant in this case. Corresponds to the type of graph to be done, for examples see ggplot2 examples for geom_line, geom_histogram, geom_bar and geom_smooth.

time_col

Character, name of the column corresponding to census time

color_col

Character, name of the colomn used to define lines' colors, defaults to "Plot".

faceting

Character, name of the variable used for faceting -see after- but defaults to FALSE i.e. no faceting. Faceting refers, here, to using a categorical, grouping variable to layout multiple plots, each corresponding to a category of the grouping variable. For example, one can do a single graph per station -if there are several forest plots in each station-, or one per taxon if looking to several specific taxa' mortality and recruitment rates in detail. If offers the advantage to avoir plotting too much information on a graph, but it can lead to difficulties to compare lines with one another. The scales are free on the x axis -basically, it correspond to several groups not necessarily having the same censusing temporal resolution-, but are bound on y -i.e., the rates are displayed on the same scale for comparison purposes.

title

Character,title of the graph.

subtitle

Character, defaulting to null. The subtitle of the graph

save_graph

Logical, indicates whether the graph must be saved or not. If TRUE, please set the above described arguments in an appropriate way.

device

Character, the graphical device to be used to save the graph

path_save

Character, a path indicating in which FOLDER the graph has to be saved

name

Character, the name of the folder containing the graph. It can be followd by the extension corresponding to the device - avoid .jpg for the jpeg device, use .jpeg instead. If the extension is missing, it is automatically added according to the selected device.

create_folder

Logical, indicated whether the folders in the given path must be created in case they do not exist yet, or not

overwrite

Logical, indicating whether a file already existing under the same name must be overwritten, or kept. In the second case, the function aborts with an explicit error message.

mortality

data.frame, output of compute_mortality

type

character, partially matching one of the following: "line", "histogram", "bar", "smooth". For the moment, only "line" is implemented, being the most relevant in this case. Corresponds to the type of graph to be done, for examples see ggplot2 examples for geom_line, geom_histogram, geom_bar and geom_smooth.

time_col

Character, name of the column corresponding to census time

color_col

Character, name of the colomn used to define lines' colors, defaults to "Plot".

faceting

Character, name of the variable used for faceting -see after- but defaults to FALSE i.e. no faceting. Faceting refers, here, to using a categorical, grouping variable to layout multiple plots, each corresponding to a category of the grouping variable. For example, one can do a single graph per station -if there are several forest plots in each station-, or one per taxon if looking to several specific taxa' recruitment and recruitment rates in detail. If offers the advantage to avoir plotting too much information on a graph, but it can lead to difficulties to compare lines with one another. The scales are free on the x axis -basically, it correspond to several groups not necessarily having the same censusing temporal resolution-, but are bound on y -i.e., the rates are displayed on the same scale for comparison purposes.

title

Character,title of the graph.

subtitle

Character, defaulting to null. The subtitle of the graph

save_graph

Logical, indicates whether the graph must be saved or not. If TRUE, please set the above described arguments in an appropriate way.

device

Character, the graphical device to be used to save the graph

path_save

Character, a path indicating in which FOLDER the graph has to be saved

name

Character, the name of the folder containing the graph. It can be followd by the extension corresponding to the device - avoid .jpg for the jpeg device, use .jpeg instead. If the extension is missing, it is automatically added according to the selected device.

create_folder

Logical, indicated whether the folders in the given path must be created in case they do not exist yet, or not

overwrite

Logical, indicating whether a file already existing under the same name must be overwritten, or kept. In the second case, the function aborts with an explicit error message.

Value

A ggplot2 graphical object.

A ggplot2 graphical object.


EcoFoG/ForestData documentation built on Aug. 23, 2019, 5:55 a.m.