getMetadata {clinDataReview}R Documentation

Read metadata file

Description

Read the metadata file from a yaml format. This function checks for existance of the metadata file and its content. In particular, within the yaml file matches the following strings:

Usage

getMetadata(filePath, namesInfo)

Arguments

filePath

String of path to file. Currently only one file path is supported. If more than one paths are provided, a warning will be printed and the first path will be used.

namesInfo

Named vector to rename the final output when printed in Rmd. The renaming happens only if the metadata info are printed in Rmd and not in the console.

Details

Note that the input names do not necessarly have to match the exact names. For instance, the user can also write "dataTimeMySDTMData", and the function will parse for existance of the string "dataTime".

Value

A list of:

Examples

# Create temporary yaml file
tmpdir <- tempdir()
library(yaml)

tmpYamlFile <- tempfile(
    pattern = "file", tmpdir = tempdir(), fileext = ".yml"
)
listArgs <- list(
    pathSDTMs = "path/To/SDTM",
    pathSDTMReformat = "path/To/SDTMReformat",
    dateTime = "20200101",
    datasetInfo = list(
        list(
            column1 = "ex.xpt",
            column2 = "20200101"
        ),
        list(
            column1 = "sl.xpt",
            column2 = "20200101",
            column3 = "OK"
        )
    )
)
write_yaml(
    listArgs,
    file = tmpYamlFile
)

# Run metadata
# Note: the 'datasetInfo' can also contain empty elements
getMetadata(filePath = tmpYamlFile)

[Package clinDataReview version 1.5.0 Index]