Skip to contents

Remove Columns from a Data Frame

Usage

removeColumns(
  dframe,
  columns = NULL,
  columnsToRemove = NULL,
  pattern = NULL,
  drop = FALSE,
  dbg = FALSE
)

Arguments

dframe

data frame,

columns

vector of column names giving the columns to remove

columnsToRemove

deprecated. Use argument columns instead.

pattern

regular expression matching the names of the columns to be removed. Will only be evaluated if no explicit column names are given in columns.

drop

if FALSE, a data frame is returned in any case, otherwise the result may be a vector if only one column remains

dbg

if TRUE (the default is FALSE), the deletion of columns is reported on the screen

Value

dframe with columns given in columns being removed. User attributes of dframe are restored.