Description Usage Arguments Value See Also Examples
Plots a daily timeseries of a single Hi-sAFe output variable.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | plot_hisafe_ts(
hop,
variables,
profile,
cumulative = FALSE,
simu.names = "all",
years = "all",
tree.ids = "all",
date.min = NA,
date.max = NA,
doy.lim = c(1, 365),
color.palette = NA,
linetype.palette = NA,
aes.cols = list(color = "SimulationName", linetype = "SimulationName"),
facet.simu = FALSE,
facet.year = FALSE,
facet.crop = FALSE,
intercrop = TRUE,
crop.points = FALSE,
plot = TRUE,
save = FALSE,
output.path = NULL
)
|
hop |
An object of class hop. |
variables |
A character vector of the names of the variables to plot.
More than one variable name can be passed, but all variables must be from the same |
profile |
A character string of the profile for which to plot a timeseries. One of 'trees', 'plot', 'climate', or 'cells'. |
cumulative |
Logical indicating wheter |
simu.names |
A character vector of the SimulationNames within |
years |
A numeric vector of the years within |
tree.ids |
A numeric vector indicating a subset of tree ids to plot. Use "all" to include all available values. |
date.min |
A character string of the minimum date to keep, in the format "YYYY-MM-DD" or of class Date. If NA, the minimum date in the output data is used. |
date.max |
A character string of the maximum date to keep, in the format "YYYY-MM-DD" or of class Date. If NA, the maximum date in the output data is used. |
doy.lim |
A numeric vector of length two providing the |
color.palette |
A character string of hex values or R standard color names defining the color palette to use in plots with multiple simulations.
If |
linetype.palette |
A character string of values defining the linetype palette to use in plots with multiple simulations.
If |
aes.cols |
A list with arguments "color" and "linetype" containing character strings of the column names to use for plot aesthetics. |
facet.simu |
A logical indicating whether the plot should be faceted by SimulationName This helps when values among simulations are overplotted. |
facet.year |
A logical indicating whether the plot should be faceted by year. This helps with seeing finer level detail. |
facet.crop |
A logical indicating whether the plot should be faceted by cropType (mainCrop vs. interCrop). Only applies when |
intercrop |
A logical indicating whether the plot should include the interCrop cropType. Only applies when |
crop.points |
Logical indicating if points should be plotted as well, with point shape desgnating the main crop name.
Only applies when |
plot |
If |
save |
If |
output.path |
A character string indicating the path to the directory where plots should be saved.
If |
If plot = TRUE
, returns a ggplot object, otherwise the data that would create the plot is returned.
If the data contains two more tree ids, the plot will be faceted by idTree.
Otherwise, if facet.year = TRUE
, plots of daily profiles will be faceted by year.
If more than one value is passed to variable
, then one plot will be created for each variable and combined using cowplot::plot_grid
.
Other hisafe plot functions:
plot_hisafe_annualcells()
,
plot_hisafe_bg()
,
plot_hisafe_cells()
,
plot_hisafe_monthcells()
,
plot_hisafe_scene()
,
plot_hisafe_tstress()
,
plot_hisafe_voxels()
1 2 3 4 5 6 7 8 9 10 11 12 | ## Not run:
# After reading in Hi-sAFe simulation data via:
mydata <- read_hisafe(path = "./")
# For a daily timeseries:
daily.plot <- plot_hisafe_ts(mydata, "carbonCoarseRoots", "trees")
# Once you have the plot object, you can display it and save it:
daily.plot
ggplot2::ggsave("carbonCoarseRoots.png", daily.plot)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.