Description Usage Arguments Details Value See Also Examples
Create source/test file for a shiny module by template file in templates directory of the packages.
1 2 3 4 5 6 7 8 9 |
name |
A character of module name, i.g. "abc". |
type |
A character of type of target file to produce:
|
source_template |
A character of R source template, default is "mod_template.R". |
test_template |
A character of R source template, default is "test-mod_template.R". |
ignore |
A logical to indicate whether the produced file to be ignored by git. |
open |
A logical to indicate whether open the produced file. |
package |
A character of package which contains templates files.
Default is current package returned by |
This function is a wrapper of usethis::use_template() to use shiny
module template.
It produces source file in "R" directory and test file in "tests/testthat" directory. If target file existed, it would not overwrite it and return FALSE.
A logical vector indicating if file was modified.
Other utils_dev:
add_analysis_module(),
debug_mode,
save_debug_data()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Not run:
# Create source file for module of "xyz"
add_shiny_module("xyz")
# Try integration test of module
xyz_app()
# Create test file for module of "xyz"
add_shiny_module("xyz", type = "test")
# Make sure tests of module is OK
testthat::test_file("tests/testthat/test-mod_xyz.R")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.