hooks: chainable method to add hooks

Description Usage Arguments Details Examples

View source: R/funcs.R

Description

chainable method to add hooks

Usage

1
hooks(bp, ...)

Arguments

bp

blueprint object

...

params to pass

Details

hooks can be added into any template, and should follow the naming convention hooks:<major_element>:<location>

For example, hooks:pk:begin might be placed at the top of $PK in a template

the [hooks()] function will inject a string into that template by matching the name.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
library(dplyr)
bp <- Blueprint$new("nonmem")

bp$template <- "
$PK
{{hooks:pk:begin}}

;; stuff in $PK

{{hooks:pk:end}}
"
bp %>%
hooks("pk:begin" = ";; comment at top of PK",
      "pk:end" = "V2 = S2/1000") %>%
render() %>%
# to print lines nicely
cat()

AstraZeneca/blueprint documentation built on May 17, 2019, 11:32 a.m.