add_analysis_module: Add skeleton of analysis module

Description Usage Arguments Details Value Functions See Also Examples

View source: R/utils_dev.R

Description

This function is a wrapper of add_shiny_module() to add skeleton for a analysis module.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
add_analysis_module(
  name,
  ignore = FALSE,
  open = TRUE,
  source_template = "mod_template.R",
  test_template = "test-mod_template.R"
)

add_cs_module(name, ignore = FALSE, open = TRUE)

add_ts_module(name, ignore = FALSE, open = TRUE)

Arguments

name

A character of module name, i.g. "abc".

ignore

A logical to indicate whether the produced file to be ignored by git.

open

A logical to indicate whether open the produced file.

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".

Details

Value

A logical vector indicating if target files created successfully.

Functions

See Also

Other utils_dev: add_shiny_module(), debug_mode, save_debug_data()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
## Not run: 

## Create skeleton of general analysis module

# Create source/test file for module of "abc"
# ("mod_abc.R" and "test-mod_abc.R")
add_analysis_module("abc")

# Try integration test of module
abc_app()

# Make sure tests of module is OK
testthat::test_file("tests/testthat/test-mod_abc.R")

## Create skeleton of cross-section analysis module

# Create source/test file for module of "abc"
# ("mod_cs_abc.R" and "test-mod_cs_abc.R")
add_analysis_module("abc")

# Try integration test of module
cs_abc_app()

# Make sure tests of module is OK
testthat::test_file("tests/testthat/test-mod_cs_abc.R")

## Create skeleton of time series analysis module

# Create source/test file for module of "abc"
# ("mod_ts_abc.R" and "test-mod_ts_abc.R")
add_analysis_module("abc")

# Try integration test of module
ts_abc_app()

# Make sure tests of module is OK
testthat::test_file("tests/testthat/test-mod_ts_abc.R")

## End(Not run)

chriszheng2016/zstexplorer documentation built on June 13, 2021, 9:47 a.m.