R/checkFormat.R

Defines functions checkFormat

Documented in checkFormat

#' Check Format of Data Contents
#' @description Do all non-ID columns have contents in Label format?
#' @import rubix
#' @export

checkFormat <-
        function(.input) {
                # Stop if empty from a previous checkpoint
                if (nrow(.input) == 0) {
                        stop('input is empty')
                }


                qa <-
                        .input %>%
                        rubix::filter_at_grepl_any(!ID,
                                                   grepl_phrase = "[0-9]{1,} .*$|NEW .*$",
                                                   evaluates_to = FALSE)

                if (nrow(qa)) {

                        qaCheckFormat <<- qa
                        stop("Some non-ID columns not in Label format. See qaCheckFormat object.")

                }

                return(.input)
        }
patelm9/hemOncExt documentation built on Dec. 2, 2020, 1:35 a.m.