The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

mighty.component mighty.component website

R-CMD-check

mighty.component provides reusable code templates, called components, for the {mighty} framework, used to generate ADaM programs. Components are Mustache templates documented with roxygen-like tags. Retrieve them from local directories, GitHub or URLs, then render, validate, evaluate and test them.

Installation

# Install the released version from CRAN:
install.packages("mighty.component")
# Install the development version from GitHub:
pak::pak("NovoNordisk-OpenSource/mighty.component")

Usage

Get a component by name from a repo. Repos can be local directories, github::owner/repo/subdir@ref or url::https://.... With several repos, they are searched in order and the first match is used.

library(mighty.component)

repo <- system.file("examples", package = "mighty.component")
ady <- get_component("ady", repos = repo)
ady
#> <mighty_component/R6>
#> ady: Analysis relative day
#> Type: column
#> Parameters:
#> • domain: `character` Name of new domain being created
#> • variable: `character` Name of new variable to create
#> • date: `character` Name of date variable to use
#> Depends:
#> • {{{domain}}}.{{{date}}}
#> • {{{domain}}}.TRTSDT
#> Outputs:
#> • {{{variable}}}

Render it with study-specific parameters:

ady$render(domain = "ADAE", variable = "ASTDY", date = "ASTDT")
#> <mighty_component_rendered/mighty_component/R6>
#> ady: Analysis relative day
#> Type: column
#> Depends:
#> • ADAE.ASTDT
#> • ADAE.TRTSDT
#> Outputs:
#> • ASTDY
#> Code:
#> ADAE <- ADAE |>
#>   dplyr::mutate(
#>     ASTDY = admiral::compute_duration(
#>       start_date = TRTSDT,
#>       end_date = ASTDT,
#>       in_unit = 'days',
#>       out_unit = 'days',
#>       add_one = TRUE
#>     )
#>   )

Rendered components can be evaluated with $eval(), written to a script with $stream(), and unit tested with get_test_component(). See vignette("mighty-component") for details.

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.