Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

remove_var

Remove variables from a data frame


Description

This function removes variables from a data frame, and is intended to use within a pipe-workflow. remove_cols() is an alias for remove_var().

Usage

remove_var(x, ...)

remove_cols(x, ...)

Arguments

x

A vector or data frame.

...

Character vector with variable names, or unquoted names of variables that should be removed from the data frame. You may also use functions like : or tidyselect's select-helpers.

Value

x, with variables specified in ... removed.

Examples

mtcars %>% remove_var("disp", "cyl")
mtcars %>% remove_var(c("wt", "vs"))
mtcars %>% remove_var(drat:am)

sjmisc

Data and Variable Transformation Functions

v2.8.6
GPL-3
Authors
Daniel Lüdecke [aut, cre] (<https://orcid.org/0000-0002-8895-3206>), Iago Giné-Vázquez [ctb], Alexander Bartel [ctb] (<https://orcid.org/0000-0002-1280-6138>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.