autogif {rcontroll}R Documentation

Create an animation from a TROLL simulation

Description

autogif() uses ggplot2 and gganimate to render an animation from a TROLL simulation. The animation can include a vertical cut in the forest structure along the X-axis highlighting either tree species (variables = 'species'), either tree height relative to their maximum height (variables = 'height_ct'), or tree carbon acquisition with net over growth primary productivity (variables = 'npp_gpp'). The animation can also include a top view of the canopy representing either canopy trees height (variables = 'height') or total leaf area index per pixel (variables = 'lai').

Usage

autogif(
  name = NULL,
  path = NULL,
  variables = c("species", "height_ct", "npp_gpp", "height", "lai"),
  global,
  species,
  climate,
  daily,
  forest = NULL,
  verbose = TRUE,
  overwrite = TRUE,
  thin = NULL
)

Arguments

name

char. Model name (if NULL timestamp).

path

char. Path to save the simulation outputs, the default is null corresponding to a simulation in memory without saved intermediary files (based on temporary files from option.rcontroll).

variables

char. Variables to build as a gif among 'species', 'height_ct', 'npp_gpp', 'height', or 'lai'.

global

df. Global parameters (e.g. TROLLv3_input or using generate_parameters()).

species

df. Species parameters (e.g. TROLLv3_species).

climate

df. Climate parameters (e.g. TROLLv3_climatedaytime12).

daily

df. Daily variation parameters (e.g. TROLLv3_daytimevar).

forest

df. TROLL with forest input, if null starts from an empty grid (default NULL) (e.g. using TROLLv3_output with get_forest()).

verbose

bool. Show TROLL outputs in the console.

overwrite

bool. Overwrite previous outputs.

thin

int. Vector of integers corresponding to the iterations to be kept to reduce output size, default is NULL and corresponds to no thinning.

Value

A list of gganimate objects corresponding to chosen outputs.

See Also

autoplot,trollsim-method

Examples

## Not run: 
data("TROLLv3_species")
data("TROLLv3_climatedaytime12")
data("TROLLv3_daytimevar")
autogif(
  name = "test", global = generate_parameters(
    cols = 100, rows = 100,
    iterperyear = 12, nbiter = 12 * 100,
    extent_visual = 10
  ),
  species = TROLLv3_species,
  climate = TROLLv3_climatedaytime12,
  daily = TROLLv3_daytimevar,
  verbose = FALSE
)

## End(Not run)


[Package rcontroll version 0.1.1 Index]