Description Usage Arguments Value See Also
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.
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"),
...
)
|
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 |
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 |
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 |
dates |
A character vector (in the format "YYYY-MM-DD") or a vector of class Date of the dates to plot.
If |
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 |
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 |
slice |
A logical indicating whether the plot from |
trees |
A logical indicating whether to plot trees via |
crops |
A logical indicating whether to plot crops via |
voxels |
A logical indicating whether to plot voxels via |
cells |
A logical indicating whether the plot from |
complete.only |
A logical indicating whether plots should only be created if ALL simulations have data for the desired crops/cells/voxels on |
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 |
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 |
... |
Other arguments passed to |
Invisibly returns the final plot object that was created.
Other hisafe visualization functions:
hisafe_root3D()
,
hisafe_slice()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.