Plugins are defined by a named list
with elements meta
(containing at
least a Name
to show in the plugin menu), shiny
(containing UI
and
Server
fields to define the Shiny UI and Server functions for the plugin),
and spec
(a specification of the data domains that the plugin uses), plus
optional fields packages
, and required_inputs
. Use plugin_Read()
to
read these element definitions and any R files in the same directory. and
spec
(a specification of the data domains that the plugin uses), plus
optional fields packages
, and required_inputs
. Use plugin_Read()
to
read these element definitions and any R files in the same directory.
Usage
plugin_Read(strPath, lWorkflows = list(), ...)
Arguments
- strPath
The directory that contains the plugin.
- lWorkflows
list
An optional named list of workflows to run in order to translate app domain data into the format required by the plugin (as defined in the pluginspec
). These workflows are ran before the plugin'sspec
is applied, and are meant to serve as a bridge between your domain data and the plugin's expected domains.- ...
Additional named arguments passed on to
fnShinyUI
and/orfnShinyServer
by name.
Value
A list
with elements meta
, shiny
, spec
, workflows
,
config
, required_inputs
, and packages
, read from the YAML file in
strPath
. As a side effect, any R
files in strPath
are also loaded
using source()
.
Examples
subjPlugin <- plugin_Read(
system.file("plugins", "ParticipantProfile", package = "gsm.app")
)
subjPlugin
#> $meta
#> $meta$Type
#> [1] "Plugin"
#>
#> $meta$ID
#> [1] "ParticipantProfile"
#>
#> $meta$Name
#> [1] "Participant Profile"
#>
#>
#> $shiny
#> $shiny$UI
#> [1] "mod_ParticipantProfile_UI"
#>
#> $shiny$Server
#> [1] "mod_ParticipantProfile_Server"
#>
#>
#> $spec
#> $spec$SUBJ
#> $spec$SUBJ$`_all`
#> $spec$SUBJ$`_all`$required
#> [1] TRUE
#>
#>
#>
#> $spec$AE
#> $spec$AE$`_all`
#> $spec$AE$`_all`$required
#> [1] TRUE
#>
#>
#>
#> $spec$ENROLL
#> $spec$ENROLL$`_all`
#> $spec$ENROLL$`_all`$required
#> [1] TRUE
#>
#>
#>
#> $spec$STUDCOMP
#> $spec$STUDCOMP$`_all`
#> $spec$STUDCOMP$`_all`$required
#> [1] TRUE
#>
#>
#>
#>
#> $required_inputs
#> [1] "participant"
#>
#> $packages
#> list()
#>
#> $workflows
#> list()
#>
#> $config
#> list()
#>