create_template {shinyscholar} | R Documentation |
Create a skeleton application containing empty modules
Description
Creates a skeleton app containing empty modules with options
controlling objects in common
and whether to include a map, code and tables
Usage
create_template(
path,
name,
common_objects,
modules,
author,
include_map = TRUE,
include_table = TRUE,
include_code = TRUE,
install = FALSE,
logger = NULL
)
Arguments
path |
character. Path to where the app should be created |
name |
character. Name of the app which will be used as the package name. Must be only characters and numbers and not start with a number. |
common_objects |
character vector. Names of objects which will be shared between modules. The objects meta, logger and state are included by default and if include_map is TRUE, the object poly is included to store polygons drawn on the map. |
modules |
dataframe. Containing one row for each module in the order to be included and with the following column names:
|
author |
character. Name of the author(s) |
include_map |
logical. Whether to include a leaflet map. Default |
include_table |
logical. Whether to include a table tab. Default |
include_code |
logical. Whether to include a tab for viewing module
code. Default |
install |
logical. Whether to install the package. Default |
logger |
Stores all notification messages to be displayed in the Log
Window. Insert the logger reactive list here for running in
shiny, otherwise leave the default |
Value
No return value, called for side effects
Author(s)
Simon E. H. Smart simon.smart@cantab.net
Examples
td <- tempfile()
dir.create(td, recursive = TRUE)
modules <- data.frame(
"component" = c("data", "data", "plot", "plot"),
"long_component" = c("Load data", "Load data", "Plot data", "Plot data"),
"module" = c("user", "database", "histogram", "scatter"),
"long_module" = c("Upload your own data", "Query a database to obtain data",
"Plot the data as a histogram", "Plot the data as a scatterplot"),
"map" = c(TRUE, TRUE, FALSE, FALSE),
"result" = c(FALSE, FALSE, TRUE, TRUE),
"rmd" = c(TRUE, TRUE, TRUE, TRUE),
"save" = c(TRUE, TRUE, TRUE, TRUE),
"download" = c(FALSE, FALSE, TRUE, TRUE),
"async" = c(TRUE, FALSE, FALSE, FALSE))
common_objects = c("raster", "histogram", "scatter")
create_template(path = td, name = "demo",
common_objects = common_objects, modules = modules,
author = "Simon E. H. Smart", include_map = TRUE, include_table = TRUE,
include_code = TRUE, install = FALSE)