shinyAppTemplate {shiny}R Documentation

Generate a Shiny application from a template

Description

This function populates a directory with files for a Shiny application.

Usage

shinyAppTemplate(path = NULL, examples = "default", dryrun = FALSE)

Arguments

path

Path to create new shiny application template.

examples

Either one of "default", "ask", "all", or any combination of "app", "rdir", "module", and "tests". In an interactive session, "default" falls back to "ask"; in a non-interactive session, "default" falls back to "all". With "ask", this function will prompt the user to select which template items will be added to the new app directory. With "all", all template items will be added to the app directory.

dryrun

If TRUE, don't actually write any files; just print out which files would be written.

Details

In an interactive R session, this function will, by default, prompt the user to select which components to add to the application. Choices are

1: All
2: app.R              : Main application file
3: R/example.R        : Helper file with R code
4: R/example-module.R : Example module
5: tests/testthat/    : Tests using the testthat and shinytest2 package

If option 1 is selected, the full example application including the following files and directories is created:

appdir/
|- app.R
|- R
|   |- example-module.R
|   `- example.R
`- tests
    |- testthat.R
    `- testthat
        |- setup-shinytest2.R
        |- test-examplemodule.R
        |- test-server.R
        |- test-shinytest2.R
        `- test-sort.R

Some notes about these files:


[Package shiny version 1.9.0 Index]