Skip to contents

If you want to create a new formods module this function will create the template files for you.

Usage

new_module_template(
  SN = "NM",
  Module_Name = "New Module",
  package = "pkgname",
  element = "analysis",
  file_dir = tempdir()
)

Arguments

SN

Module short name

Module_Name

Module long name

package

Name of package that will contain the module

element

What you would call the thing the module provides for example the FG module provides "figures", the DW module provides "data views".

file_dir

Directory to save file

Value

list with the following elements:

  • mc: Module components.

  • server: Server.R file.

  • yaml: Yaml configureation file.

Each of these is a list with paths to the respective files:

  • source: Template source.

  • dest: Destination file name.

  • dest_full: Full path to the destination file name.

Examples

new_module_template()
#> $mc
#> $mc$source
#> [1] "/private/var/folders/l9/6pm7xq5j1hn6l00zrs22j6mc0000gn/T/RtmpEfG5in/temp_libpath6d4076dedebf/formods/templates/ZZ_module_components.R"
#> 
#> $mc$dest
#> [1] "NM_module_components.R"
#> 
#> $mc$dest_full
#> [1] "/var/folders/l9/6pm7xq5j1hn6l00zrs22j6mc0000gn/T//Rtmp5FPHh9/NM_module_components.R"
#> 
#> 
#> $server
#> $server$source
#> [1] "/private/var/folders/l9/6pm7xq5j1hn6l00zrs22j6mc0000gn/T/RtmpEfG5in/temp_libpath6d4076dedebf/formods/templates/ZZ_Server.R"
#> 
#> $server$dest
#> [1] "NM_Server.R"
#> 
#> $server$dest_full
#> [1] "/var/folders/l9/6pm7xq5j1hn6l00zrs22j6mc0000gn/T//Rtmp5FPHh9/NM_Server.R"
#> 
#> 
#> $yaml
#> $yaml$source
#> [1] "/private/var/folders/l9/6pm7xq5j1hn6l00zrs22j6mc0000gn/T/RtmpEfG5in/temp_libpath6d4076dedebf/formods/templates/ZZ.yaml"
#> 
#> $yaml$dest
#> [1] "NM.yaml"
#> 
#> $yaml$dest_full
#> [1] "/var/folders/l9/6pm7xq5j1hn6l00zrs22j6mc0000gn/T//Rtmp5FPHh9/NM.yaml"
#> 
#> 
#> $funcs
#> $funcs$source
#> [1] "/private/var/folders/l9/6pm7xq5j1hn6l00zrs22j6mc0000gn/T/RtmpEfG5in/temp_libpath6d4076dedebf/formods/templates/ZZ_funcs.R"
#> 
#> $funcs$dest
#> [1] "NM_funcs.R"
#> 
#> $funcs$dest_full
#> [1] "/var/folders/l9/6pm7xq5j1hn6l00zrs22j6mc0000gn/T//Rtmp5FPHh9/NM_funcs.R"
#> 
#>