hisafe_snapshot: Create daily plots combining hisafe_slice() &...

Description Usage Arguments Value See Also

View source: R/visualize.R

Description

Creates daily plots combining hisafe_slice & plot_hisafe_cells and writes them to an output directory. Requires the egg and gtable packages. This function creates the raw materials (daily images) for animations/videos of Hi-sAFe simulations.

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
28
hisafe_snapshot(
  hop,
  output.path = NULL,
  file.prefix = "HISAFE_Snapshot",
  cells.var = "relativeTotalParIncident",
  date.min = NA,
  date.max = NA,
  dates = NULL,
  rel.dates = NULL,
  simu.names = "all",
  plot.x = "x",
  slice = TRUE,
  trees = TRUE,
  crops = TRUE,
  voxels = TRUE,
  cells = TRUE,
  complete.only = FALSE,
  mem.max = 10,
  device = "png",
  dpi = 250,
  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"),
  ...
)

Arguments

hop

An object of class hop.

output.path

A character stting indicating the path to the directory where plots should be saved. If no value is provided, the experiment/simulation path is read from the hop object, and a directory is created there called "analysis/snapshots".

file.prefix

A character string of the prefix with which to name each plot file. File names will be this prefix appended with the date.

cells.var

A character string of the name of the variable to pass to plot_hisafe_cells.

date.min

A character string of the minimum date to plot, in the format "YYYY-MM-DD" or of class Date. If NA, the minimum date in hop is used. Only used if dates is NULL.

date.max

A character string of the maximum date to plot, in the format "YYYY-MM-DD" or of class Date. If NA, the maximum date in hop is used. Only used if dates is NULL.

dates

A character vector (in the format "YYYY-MM-DD") or a vector of class Date of the dates to plot. If NULL, then date.max and date.min are used instad.

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 variables. In the plot, all variables will be scaled to be between their minimum and maximum values across these dates.

simu.names

A character vector of the SimulationNames within hop to include. 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. This will be applied to the plots from both hisafe_slice and plot_hisafe_cells. Setting to "xy" is only possible when hop contains or is filtered to a single simulation.

slice

A logical indicating whether the plot from hisafe_slice should be included.

trees

A logical indicating whether to plot trees via plot_hisafe_cells.

crops

A logical indicating whether to plot crops via plot_hisafe_cells.

voxels

A logical indicating whether to plot voxels via plot_hisafe_cells.

cells

A logical indicating whether the plot from plot_hisafe_cells should be included.

complete.only

A logical indicating whether plots should only be created if ALL simulations have data for the desired crops/cells/voxels on date.

mem.max

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

device

Graphical device to use for output files. See ggplot2::ggsave().

dpi

Resolution of output files. See ggplot2::ggsave().

vars

A list of variable names passed to hisafe_slice. See hisafe_slice for details.

...

Other arguments passed to hisafe_slice.

Value

Invisibly returns the final plot object that was created.

See Also

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


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