Read yaml input into data frame

yaml_as_df(path, quiet = FALSE)

Arguments

path

to the yaml source file

quiet

if TRUE, suppress messages

Prototyped tables

A prototyped table has one row identified as the prototype and defines the table column names as well as the required number of columns. This is similar behavior to what dplyr::tribble() does. Specify a prototype column name under SETUP__:. You must provide names for all columns in the prototype. Other rows will inherit those names and you must enter a number of columns in other rows equal to the number found in the prototype. If a prototype row is used, then other rows do not need to be entered as (named) lists, but can be entered as arrays; they will be coerced to list and named according to the prototype.

Examples

path <- system.file("yaml", "table.yml", package = "pmtables") yaml_as_df(path)
#> # A tibble: 4 × 5 #> study description population subjects endpoints #> <chr> <chr> <chr> <int> <chr> #> 1 12-DEMO-222 "single ascending dose PK s… healthy subjects 12 PK #> 2 11-DEMO-221 "multiple ascending dose PK… healthy subjects 30 PK #> 3 13-DEMO-311 "phase2a study in patients" patients with e… 60 PK, E2 #> 4 18-DEMO-001 "pivitol phase 3 registrati… patients with e… 240 PK, E2, NM…
# Example prototyped table if (FALSE) { file <- system.file("yaml", "prototype.yaml", package = "pmtables") cat(readLines(file), sep = "\n") }