rosetta | R Documentation |
Translate among various idioms for expressing parameter names
library(magrittr)
options(project = system.file('project/model',package='nonmemica'))
# we generate some nonmem parameter names in nonmem format
1001 %>% nms_nonmem -> nonmem
nonmem
# from these we generate canonical and pmxTools equivalents
canonical <- nms_canonical(nonmem)
pmxtools <- nms_pmx(nonmem)
canonical
pmxtools
# We demonstrate equivalence
stopifnot(identical(nonmem, nms_nonmem(canonical)))
stopifnot(identical(nonmem, nms_nonmem(pmxtools)))
stopifnot(identical(canonical, nms_canonical(nonmem)))
stopifnot(identical(canonical, nms_canonical(pmxtools)))
stopifnot(identical(pmxtools, nms_pmx(nonmem)))
stopifnot(identical(pmxtools, nms_pmx(canonical)))
# on-the-fly conversions
nonmem %>% class
nonmem %>% nms_pmx
nonmem %>% nms_canonical
nonmem %>% nms_canonical %>% nms_pmx
nonmem %>% nms_canonical %>% nms_pmx %>% nms_nonmem
# comparison
data.frame(
can = canonical,
non = nonmem,
pmx = pmxtools,
psn = 1001 %>% nms_psn
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.