plot_hisafe_monthcells: Tile plot of Hi-sAFe monthCells output variable

Description Usage Arguments Details Value See Also Examples

View source: R/plot.R

Description

Plots a tile plot of a single Hi-sAFe monthCells output variable.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
plot_hisafe_monthcells(
  hop,
  variable = "monthRelativeTotalParIncident",
  colfacet = "SimulationName",
  rowfacet = "Year",
  simu.names = "all",
  years = seq(min(hop$monthCells$Year), max(hop$monthCells$Year), 5),
  months = 6,
  plot.x = "x",
  trees = TRUE,
  canopies = TRUE,
  tree.simus = FALSE,
  plot = TRUE
)

Arguments

hop

An object of class hop.

variable

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

colfacet

One of "Year", "Month", or "SimulationName", indicating which variable to use for column faceting.

rowfacet

One of "Year", "Month", or "SimulationName", indicating which variable to use for row faceting.

simu.names

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

years

A numeric vector containing the years to include. Use "all" to include all available values.

months

A numeric vector containing the months to include. Use "all" to include all available values.

plot.x

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

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.

tree.simus

Logical indicating whether only simulations containing trees should be plotted.

plot

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

Details

This function is very picky! You can only facet by two of the three manipulable variables: SimulationName, Year, Month. You must ensure that the one varibale not used for faceting is fixed at a single value.

Value

Returns a ggplot object.

See Also

Other hisafe plot functions: plot_hisafe_annualcells(), plot_hisafe_bg(), plot_hisafe_cells(), 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
13
14
15
16
17
18
19
20
21
## Not run: 
# After reading in Hi-sAFe simulation data via:
mydata <- read_hisafe(path = "./")

# You can create a tile plot of monthDirectParIncident:
tile.plot <- plot_hisafe_monthcells(mydata, "monthDirectParIncident")

# The default settings use data from June and facet by Year and Simulation Name.
# If you instead want to just look at Year 20 and facet by Month and SimulationName:
tile.plot2 <- plot_hisafe_monthcells(mydata, "monthDirectParIncident",
                                     rowfacet = "SimulationName",
                                     colfacet = "Month",
                                     simu.names = "all",
                                     years = 2000,
                                     months = 1:12)

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

## End(Not run)

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