Learn R Programming

SpaDES (version 1.2.0)

shine: Display a simple, interactive shiny app of the simList

Description

Currently, this is quite simple. It creates a side bar with the simulation times, plus a set of tabs, one for each module, with numeric sliders. Currently, this does not treat NAs correctly. Also, it is slow (shiny is not built to be fast out of the box). Currently, it does not show plotting updates; it only shows the final output of a spades call. There are two buttons, one to run the entire spades call, the other to do just one time step at a time. It can be repeatedly pressed.

Usage

shine(sim, title = "SpaDES App", debug = FALSE, ...)
"shine"(sim, title = "SpaDES App", debug = FALSE, ...)

Arguments

sim
a simList object
title
character string. The title of the shiny page.
debug
Logical. If TRUE, then will show spades event debugger in console.
...
additional arguments. Currently not used

Examples

Run this code
## Not run: 
# times <- list(start = 0.0, end = 20.0)
# parameters <- list(
#   .globals = list(stackName = "landscape", burnStats = "nPixelsBurned"),
#   .progress = list(NA),
#   randomLandscapes = list(nx = 100L, ny = 100L, inRAM = TRUE),
#   fireSpread = list(nFires = 10L, spreadprob = 0.225, its = 1e6, persistprob = 0,
#                     returnInterval = 10, startTime = 0,
#                     .plotInitialTime = 0.0, .plotInterval = 10),
#   caribouMovement = list(N = 100L, moveInterval = 1,
#                          .plotInitialTime = 1, .plotInterval = 1)
# )
# modules <- list("randomLandscapes", "fireSpread", "caribouMovement")
# path <- list(modulePath = system.file("sampleModules", package = "SpaDES"),
#              outputPath = file.path(tempdir(), "simOutputs"))
# 
# mySim <- simInit(times = times, params = parameters, modules = modules, path = path)
# 
# shine(mySim)
# 
# # if the user wants to see the events go by, which can help with debugging:
# shine(mySim, debug=TRUE)
# ## End(Not run)

Run the code above in your browser using DataLab