R/dt.remove.variables.R

Defines functions dt.remove.variables

Documented in dt.remove.variables

#'dt.remove.variables
#' @description  a function to remove selected columns from dat
#'
#' @param  dat  a data.frame object
#' @param the.variables  a character vector with the column names to be removed from dat.
#'
#' @import data.table
#' @export
dt.remove.variables <- function(dat, the.variables) {
  data.table::setDT(dat)
  
  dat[, (the.variables) := NULL]
  
  return(dat)
}
dachosen1/DTwrappers documentation built on Dec. 25, 2019, 8:04 a.m.