R/dataPrep.R

Defines functions dataPrep

dataPrep <- function(data = train,
                     allowNAInData = FALSE,
                     recipe = rec) {
  trainSet <- recipe %>%
    recipes::bake(data)

  if (allowNAInData == FALSE) {
    trainSet <- trainSet %>%
      dplyr::select_if(all(!is.na(x)))
  }

  return(trainSet)
}
amanda-park/easytidymodels documentation built on Dec. 13, 2021, 11:28 a.m.