This utility function retrieve tidymodules from the central ModStore using module namespace/id and/or group

getMod(id = 1, group = NULL)

Arguments

id

Name or Id of the module

group

Group name

Examples


MyModule <- R6::R6Class("MyModule", inherit = tidymodules::TidyModule)
MyModule$new("MyFirst")
#> Module Namespace MyFirst
#> Module Session global_session
#> - Class MyModule << TidyModule << R6
#> - Input [0]
#> - Output [0]
MyModule$new("MySecond")
#> Module Namespace MySecond
#> Module Session global_session
#> - Class MyModule << TidyModule << R6
#> - Input [0]
#> - Output [0]
MyModule$new("MyThird", group = "B")
#> Module Namespace B-MyThird
#> Module Group B
#> Module Session global_session
#> - Class MyModule << TidyModule << R6
#> - Input [0]
#> - Output [0]

# MyFirst
getMod(1)
#> Module Namespace MyModule-1
#> Module Session global_session
#> - Class MyModule << TidyModule << R6
#> - Input [0]
#> - Output [0]
getMod("MyFirst")
#> Module Namespace MyFirst
#> Module Session global_session
#> - Class MyModule << TidyModule << R6
#> - Input [0]
#> - Output [0]

# MySecond
getMod(2)
#> Module Namespace MyModule-2
#> Module Session global_session
#> - Class MyModule << TidyModule << R6
#> - Input [0]
#> - Output [0]

# MyThird
getMod(2)
#> Module Namespace MyModule-2
#> Module Session global_session
#> - Class MyModule << TidyModule << R6
#> - Input [0]
#> - Output [0]
getMod("B-MyThird")
#> Module Namespace B-MyThird
#> Module Group B
#> Module Session global_session
#> - Class MyModule << TidyModule << R6
#> - Input [0]
#> - Output [0]
getMod(1, group = "B")
#> Module Namespace B-MyThird
#> Module Group B
#> Module Session global_session
#> - Class MyModule << TidyModule << R6
#> - Input [0]
#> - Output [0]