R/remove_temp.R

Defines functions remove_temp

Documented in remove_temp

#' Remove Temporary Variables from a Dataset
#'
#' This packages uses the convention of naming temporary variables with
#' the pattern `.{semantic_name}_tmp_`. This function removes all variables with
#' such a name.
#'
#' @param .data A data frame or data frame extension
#'
#' @return The data frame with temporary variables removed
remove_temp <- function(.data) {
  dplyr::select(.data, -dplyr::matches(c("^[.].*_tmp_$", "^[.]tmp_$")))
}
jesse-smith/covidsms documentation built on Dec. 25, 2021, 4:24 a.m.