powered by
Check for complete columns in the data and fail (or warn) if incomplete. Missing columns that are required to be complete are ignored.
check_cols_complete( data, required_cols, empty_values = c(NA, ""), strict = TRUE, success_msg = "Required columns present are complete", fail_msg = "Some required columns are not complete" )
Data to check
A character vector of the required columns to check for completeness.
Values that are considered empty. Defaults to NA and "".
NA
""
If FALSE, return a "check_warn" object; if TRUE, return a "check_fail" object
FALSE
"check_warn"
TRUE
"check_fail"
Message indicating the check succeeded.
Message indicating the check failed.
A condition object indicating whether the data contains columns that are not complete.
# NOT RUN { dat <- data.frame(specimenID = c("x", "y"), organ = c(NA, NA)) check_cols_complete(dat, c("specimenID", "organ")) # }
Run the code above in your browser using DataLab