Cleans a dataset by updating values above a certain maximum

clean.Max(bllFlowModel, ...)

# S3 method for BLLFlow
clean.Max(bllFlowModel, print = FALSE, ...)

Arguments

bllFlowModel

The bllFlowModel we will clean

...

Arguments to the next method in the chain

print

A boolean which when set to TRUE prints logs of what the operation did

Value

bllFlowModel that has had its data modified by the paramaters located in the variables object

Methods (by class)

  • BLLFlow: Cleans the data using the max and outlier columns in the variables sheet of the MSW. Outlier method is applied on a row if any of the variable values for that row is greater than the max value as specified in the variables sheet. Outlier checking for the column is not applied if max value is NA.

    Currently supported outlier methods are:
    Delete - Specified as 'delete' in MSW. Deletes the row from the data. Deleted rows are stored in the metadata variable under the deletedRows name.
    Missing - Specified as 'missing' in MSW. Column value for that row which does not meet the criteria is set to NA.
    Not Applicable - TODO
    Set to value - Specified as a number value in MSW. Column value for the row is set to the value specified in the outlier column.

Examples

# Load packages library(survival) library(bllflow) # Read in the data we will use data(pbc) # Read in the MSW and variable_details sheet for the PBC model variablesSheet <- read.csv(system.file("extdata", "PBC-variables.csv", package="bllflow")) variableDetailsSheet <- read.csv(system.file("extdata", "PBC-variableDetails.csv", package="bllflow")) # Create a bllFlow R object for the PBC model using the above variables as args pbcModel <- bllflow::BLLFlow(pbc, variablesSheet, variableDetailsSheet) # Clean the data cleanedPbcModel <- bllflow::clean.Max(pbcModel) # If you wish to be updated in the log on what the function does set print to true cleanedPbcModel <- bllflow::clean.Max(cleanedPbcModel, print=TRUE)
#> [1] "clean.max.BLLFlow: 405 rows were checked and 0 rows were set to delete. Reason: Rule age max at 70 "