Learn R Programming

sjmisc (version 2.6.3)

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.

Usage

remove_var(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 dplyr's select_helpers.

Value

x, with variables specified in ... removed.

Examples

Run this code
# NOT RUN {
mtcars %>% remove_var("disp", "cyl")
mtcars %>% remove_var(c("wt", "vs"))
mtcars %>% remove_var(drat:am)

# }

Run the code above in your browser using DataLab