Generate a Shiny application from a templateSource:
This function populates a directory with files for a Shiny application.
Path to create new shiny application template.
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.
TRUE, don't actually write any files; just print out which files would be written.
In an interactive R session, this function will, by default, prompt the user to select which components to add to the application. Choices are
If option 1 is selected, the full example application including the following files and directories is created:
Some notes about these files:
app.Ris the main application file.
All files in the
R/subdirectory are automatically sourced when the application is run.
R/example-module.Rare automatically sourced when the application is run. The first contains a function
lexical_sort(), and the second contains code for module created by the
moduleServer()function, which is used in the application.
tests/contains various tests for the application. You may choose to use or remove any of them. They can be executed by the
tests/testthat.Ris a test runner for test files in the
tests/testthat/directory using the shinytest2 package.
tests/testthat/test-examplemodule.Ris a test for an application's module server function.
tests/testthat/test-server.Ris a test for the application's server code
tests/testthat/test-shinytest2.Ris a test that uses the shinytest2 package to do snapshot-based testing.
tests/testthat/test-sort.Ris a test for a supporting function in the