hisafe_slice: Plot a "sliced" profile of the simulated Hi-sAFe scene

Description Usage Arguments Value See Also

View source: R/visualize.R

Description

Plots a "sliced" profile of the simulated Hi-sAFe scene. Requires the ggforce package.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
hisafe_slice(
  hop,
  date,
  simu.names = "all",
  tree.ids = "all",
  plot.x = "x",
  Y = "all",
  scene.shift = 0,
  rel.dates = NULL,
  height.dates = date,
  max.soil.depth = NA,
  vars = list(crown.alpha = "leafArea", trunk.alpha = "carbonLabile", crop.alpha =
    "lai", yield.alpha = "eai", voxel.alpha = "totalTreeRootDensity", voxel.border =
    "cropRootDensity", voxel.L.size = "theta", voxel.C.size =
    "totalTreeCoarseRootBiomass", voxel.R.size = "mineralNitrogenStock", voxel.L.alpha =
    "totalTreeWaterUptake", voxel.C.alpha = "fineRootCost", voxel.R.alpha =
    "totalTreeNitrogenUptake"),
  tree.rel.vars = "SYT",
  crop.rel.vars = "SY",
  voxel.rel.vars = "SY",
  trees = TRUE,
  crops = TRUE,
  voxels = TRUE,
  climate = TRUE,
  mem.max = 0,
  plot.rows = 1
)

Arguments

hop

An object of class hop.

date

A character string of the date to plot, in the format "YYYY-MM-DD" or of class Date.

simu.names

A character vector of the SimulationNames within hop to include. Use "all" to include all available values.

tree.ids

A numeric vector indicating a subset of tree ids to plot. Use "all" to include all available values.

plot.x

Either "x" or "y", indicating which axis of the Hi-sAFe scene should be plotted along the x-axis of the plot.

Y

A numeric vector indicating a subset of cell locations to include when summarizing cell/voxel data. If plot.x is "x", then this refers to the y coordinates of cells. If plot.x is "y", then this refers to the x coordinates of cells.

scene.shift

A number indicating the number of cells to shift the scene -x (if plot.x = "x") or -y (if plot.x = "y") direction. Cell rows less than this value will be "flipped" to adjoin the right side of the plot.

rel.dates

A character vector (in the format "YYYY-MM-DD") or a vector of class Date of the dates from which to scale all aesthetics set by vars. In the plot, all aesthetics set by vars will be scaled to be between the minimum and maximum values across these dates.

height.dates

A character vector (in the format "YYYY-MM-DD") or a vector of class Date of the dates from which the plot height should be determined from the maximum height of trees and crops in this range.

max.soil.depth

The maximum depth for which to plot voxel data. To reduce confusion, this value can be supplied as positive or negative.

vars

A list of variable names specifying which simulated variables in hop should be represented by various plot components. Plot components include:

  • "crown.alpha" - transparency of the tree crown

  • "trunk.alpha" - transparency of the tree trunk

  • "crop.alpha" - transparency of the crop

  • "yield.alpha" - transparency of the yield portion of the crop

  • "voxel.alpha" - transparency of the voxel

  • "voxel.border" - thickness of the voxel border

  • "voxel.L.size" - size of the left circle within the voxel

  • "voxel.C.size" - size of the center circle within the voxel

  • "voxel.R.size" - size of the right circle within the voxel

  • "voxel.L.alpha" - transparency of the left circle within the voxel

  • "voxel.C.alpha" - transparency of the center circle within the voxel

  • "voxel.R.alpha" - transparency of the right circle within the voxel

tree.rel.vars

A character string indicating how to group data to determine the maximum value by which to scale tree aesthetics set by vars. This can include any combination of "s" for simulation, "y" for year, and "t" for tree. For example, "sy" would scale all aesthetics set by vars to the maximum value of each variable in each simulation-year combination. Passing an empyt string ("") means that all tree aesthetics set by vars will be scaled to maximum value across all simulations, years, and trees. Values can include upper case and/or lower case letters.

crop.rel.vars

Same as tree.rel.vars but for crop aesthetics set by vars. Doesn't include "t".

voxel.rel.vars

Same as tree.rel.vars but for voxel aesthetics set by vars. Doesn't include "t".

trees

A logical indicating whether or not to plot the trees in the scene.

crops

A logical indicating whether or not to plot the crops in the scene.

voxels

A logical indicating whether or not to plot the voxels in the scene.

climate

A logical indicating whether or not to plot climate aspects (precipitation, water table) in the scene.

mem.max

An integer specifying the maximum number of days into the past to search for crop/voxel data when no data is available for date within hop.

plot.rows

An integer specifying nrow passed to ggplot2::facet_wrap.

Value

A ggplot object.

See Also

Other hisafe visualization functions: hisafe_root3D(), hisafe_snapshot()


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