plot_hisafe_cycle_ts: Plot daily timeseries of major cycles

Description Usage Arguments Value See Also Examples

View source: R/cycles.R

Description

Plots a daily timeseries of tree carbon pools, water uptake, nitrogen uptake, light capture, or tree carbon incrememnt.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
plot_hisafe_cycle_ts(
  hop,
  cycle,
  years,
  simu.names = "all",
  tree.ids = "all",
  doy.lim = c(1, 366),
  color.palette = NULL,
  crop.names = c("Main crop", "Inter crop"),
  pheno.lines = TRUE,
  branch.pruning.lines = TRUE,
  root.pruning.lines = TRUE,
  trim = TRUE,
  plot = TRUE
)

Arguments

hop

An object of class hop or face.

cycle

One of "carbon", "nitrogen", "water", "light", "yield" "carbon-increment", or "carbon-allocation".

years

A numeric vector of the calendar years to include. If more than one year is provided, years are used as facets, and only a single value can be supplied to simu.names. Use "all" to include all available values.

simu.names

A character vector of the SimulationNames within hop to include. Use "all" to include all available values. If more than one value is supplied to years, then a single value must be suppied to simu.names.

tree.ids

A numeric vector indicating a subset of tree ids to plot. Use "all" to include all available values. This only applies when cycle is "carbon". Must only include a single tree id for "carbon-allocation".

doy.lim

A numeric vector of length two providing the c(minimum, maximum) of julian days to plot.

color.palette

A character stirng of hex values or R standard color names defining the color palette to use in plots with multiple simulations. If NULL, the default, then the default color palette is a color-blind-friendly color palette.

crop.names

A character vector of length 2 containing the names to use in the legend for the mainCrop and interCrop of Hi-sAFe, in that order.

pheno.lines

Logical indicating whether or not vertical lines should be plotted on dates of tree phenoloigical stage changes

branch.pruning.lines

Logical indicating whether or not vertical lines should be plotted on dates of branch pruning

root.pruning.lines

Logical indicating whether or not vertical lines should be plotted on dates of root pruning

trim

Logical indicating whether or not to trim white space before and after the tree growth season when cycle is "carbon-increment"

plot

If TRUE, the default, a ggplot object is returned. If FALSE, the data that would create the plot is returned.

Value

If plot = TRUE, returns a ggplot object. If plot = FALSE, returns the data that would create the plot. If hop contains more than one simulation, the plot will be faceted by SimulationName.

See Also

Other hisafe analysis functions: LER_summary(), LER(), analyze_hisafe(), cycle_summary(), hisafe_budget(), plot_hisafe_cycle_bar(), stics_budget_comp(), write_hop()

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
# To plot the simulated light capture in the year 2000:
light.capture.plot <- plot_hisafe_cycle_ts(myhop, "light", 2000)

# Once you have the plot object, you can display it and save it:
water.plot
ggsave_fitmax("light_capture.png", light.capture.plot)

## End(Not run)

kevinwolz/hisafer documentation built on Oct. 19, 2020, 4:43 p.m.