Writes a variable details CSV sheet to file

WriteDDIPopulatedMSW(x, ...)

# S3 method for BLLFlow
WriteDDIPopulatedMSW(x, pathToWriteTo, newFileName, ...)

# S3 method for BLLFlowDDI
WriteDDIPopulatedMSW(x, pathToMSW, mswName,
  newName = NULL, ...)

Arguments

x

Object on which we will dispatch

...

The next method in the chain

pathToWriteTo

A string containing the path to the directory where the file should be writtem

newFileName

A string containing the name of the written file

pathToMSW

A string containing the path to the directory with the variable details sheet

mswName

A string containing the name of the variable details sheet

newName

A string containing the name of the new variable details sheet

Methods (by class)

  • BLLFlow: The populatedVariableDetails data frame within a bllflow model is written as a CSV file

  • BLLFlowDDI: Updates an existing variable details worksheet with metadata from a ddi document and then writes the new variable details sheet to file. The new sheet is saved in the same directory as the old sheet. The first argument should be an object returned by the ReadDDI function.

Examples

# \dontrun{ # Writing the variable details sheet within a bllflow model # _________________________________________________________ library(survival) library(bllflow) data(pbc) pbcDDI <- bllflow::ReadDDI(system.file("extdata", "", package="bllflow"), "pbcDDI.xml") # Read the MSW files variables <- read.csv(system.file("extdata", "PBC-variables.csv", package="bllflow")) variableDetails <- read.csv(system.file("extdata", "PBC-variableDetails.csv", package="bllflow")) # Create a BLLFlow object and add labels. pbcModel <- bllflow::BLLFlow(pbc, variables, variableDetails, pbcDDI)
#> Warning: Row 2 : valueLabelStart column has value " male " but DDI value is " Male ". Not overwriting
#> Warning: Row 2 : from column has value " 1 " but DDI value is " 1:1 ". Not overwriting
#> Warning: Row 1 : valueLabelStart column has value " female " but DDI value is " Female ". Not overwriting
#> Warning: Row 1 : from column has value " 2 " but DDI value is " 2:2 ". Not overwriting
#> Warning: Row 9 : valueLabelStart column has value " No edema " but DDI value is " edema despite diuretic therapy ". Not overwriting
#> Warning: Row 9 : label column has value " Edema " but DDI value is " edema ". Not overwriting
#> Warning: Row 9 : from column has value " 0 " but DDI value is " 1:1 ". Not overwriting
bllflow::WriteDDIPopulatedMSW(pbcModel, "../../inst/extdata/", "newMSWvariableDetails.csv") # } # \dontrun{ # Updating a variable details sheet from file and writing the updated version # ___________________________________________________________________________ library(bllflow) pbcDDI <- bllflow::ReadDDI(system.file("extdata", "", package="bllflow"), "pbcDDI.xml") bllflow::WriteDDIPopulatedMSW(pbcDDI, "../../inst/extdata/", "PBC-variableDetails.csv", "newName.csv")
#> Warning: Row 2 : valueLabelStart column has value " male " but DDI value is " Male ". Not overwriting
#> Warning: Row 2 : from column has value " 1 " but DDI value is " 1:1 ". Not overwriting
#> Warning: Row 1 : valueLabelStart column has value " female " but DDI value is " Female ". Not overwriting
#> Warning: Row 1 : from column has value " 2 " but DDI value is " 2:2 ". Not overwriting
#> Warning: Row 9 : valueLabelStart column has value " No edema " but DDI value is " edema despite diuretic therapy ". Not overwriting
#> Warning: Row 9 : label column has value " Edema " but DDI value is " edema ". Not overwriting
#> Warning: Row 9 : from column has value " 0 " but DDI value is " 1:1 ". Not overwriting
# }