create_template.Rd
Creates a skeleton app containing empty modules
create_template(
path,
name,
include_map,
include_table,
include_code,
common_objects,
modules,
author,
install,
logger = NULL
)
character. Path to where the app should be created
character. Name of the app which will be used as the package name
logical. Whether to include a leaflet map
logical. Whether to include a table tab
logical. Whether to include a tab for viewing module code
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.
A dataframe containing long and short names of components (tabs) and modules in the order to be included and whether they should include mapping, save, markdown and result functionality. The component and module columns are used to generate file names for the modules. The long_component and long_module columns are used to generate UI and so should be formatted appropriately.
character. Name of the author(s)
logical. Whether to install the package
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 NULL
if (FALSE) {
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))
common_objects = c("raster", "histogram", "scatter")
create_template(path = "~/Documents", name = "demo",
include_map = TRUE, include_table = TRUE, include_code = TRUE,
common_objects = common_objects, modules = modules,
author = "Simon E. H. Smart",
install = TRUE)
}