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 study"     healthy s…       12 PK       
#> 2 11-DEMO-221 "multiple ascending dose PK study"   healthy s…       30 PK       
#> 3 13-DEMO-311 "phase2a study in patients"          patients …       60 PK, E2   
#> 4 18-DEMO-001 "pivitol phase 3 registration trial… patients …      240 PK, E2, …

# Example prototyped table
if (FALSE) {
file <- system.file("yaml", "prototype.yaml", package = "pmtables")
cat(readLines(file), sep = "\n")
}