plot_hisafe_cells: Tile plot of Hi-sAFe cells output variable

Description Usage Arguments Value See Also Examples

View source: R/plot.R

Description

Plots a tile plot of a single Hi-sAFe cells output variable. SimulationName is used as the column facet. Date is used as the row facet.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
plot_hisafe_cells(
  hop,
  variable,
  dates,
  start.date = NULL,
  rel.dates = dates,
  simu.names = "all",
  X = NA,
  plot.x = "x",
  N.arrow = "#000000",
  trees = TRUE,
  canopies = TRUE,
  plot = TRUE,
  mem.max = 0,
  for.anim = FALSE,
  cumu.scale = TRUE
)

Arguments

hop

An object of class hop.

variable

A character string of the name of the variable to color the tiles.

dates

A character vector (in the format "YYYY-MM-DD") or a vector of class Date of the dates to include.

start.date

If NULL, the default, then no cumulation of values occurs. Otherwise, a character string (in the format "YYYY-MM-DD") or an object of class Date indicating the date from which cumulation of variable should be calculated.

rel.dates

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

simu.names

A character string containing the SimulationNames to include. Use "all" to include all available values.

X

A numeric vector of the x values of the cells to include. If NA, the default, then all x values are used.

plot.x

Either "x" or "y", indicating which axis of the simulation scene should be plotted on the x-axis of the plot.

N.arrow

A character string indicating the color of the north arrow. String must be a valid color name passed to ggplot2. Use NA to not plot the north arrow.

trees

Logical indicating if a point should be plotted at the location of each tree.

canopies

Logical indicating if an elipsoid should be plotted representing the size of each tree canopy.

plot

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

mem.max

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

for.anim

If TRUE, the plot formatting is simplified for use in animations.

cumu.scale

If TRUE, the color scale is determined by all dates from start.date to dates. If FALSE, the color scale is determined only by rel.dates. Only applies when start.dates is not NULL.

Value

Returns a ggplot object.

See Also

Other hisafe plot functions: plot_hisafe_annualcells(), plot_hisafe_bg(), plot_hisafe_monthcells(), plot_hisafe_scene(), plot_hisafe_tstress(), plot_hisafe_ts(), plot_hisafe_voxels()

Examples

 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 = "./")

# You can create a tile plot of relativeDirectParIncident:
tile.plot <- plot_hisafe_cells(mydata, "relativeDirectParIncident", paste(1998, 6:8, 1, sep = "-"))

# Once you have the plot object, you can display it and save it:
tile.plot
ggsave_fitmax("tiled_relativeDirectParIncident.png", tile.plot)

## End(Not run)

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