Clean a dataset by updating values below a certain minimum
clean.Min(bllFlowModel, ...) # S3 method for BLLFlow clean.Min(bllFlowModel, print = FALSE, ...)
The bllflow model we will clean
Arguments to the next method in the chain
A boolean which when set to TRUE prints logs of what the operation did
A bllflow named list whose dataset was cleaned
BLLFlow: Cleans the data using the min 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 less than the min value as specified in the variables
sheet. Outlier checking for the column is not applied if min value is NA.
Currently supported outlier methods are:
1. Delete - Specified as 'delete' in MSW. Deletes the row from the data.
number of deleted rows as well as their reason for deletion is stored in the metaData variable under the deletedRows name.
2. Missing - Specified as 'missing' in MSW. Column value for that row which does not meet the criteria is set to NA.
3. Not Applicable - TODO.
4. 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.
# 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.Min(pbcModel) # If you wish to be updated in the log on what the function does set print to true cleanedPbcModel <- bllflow::clean.Min(cleanedPbcModel, print=TRUE)#>  "clean.min.BLLFlow: 349 rows were checked and 0 rows were set to delete. Reason: Rule age min at 40 "