conditional_drop: Drop columns from data frame if they exist

View source: R/data.R

conditional_dropR Documentation

Drop columns from data frame if they exist

Description

conditional_drop removes a set of columns passed by a character vector if they exist in the data frame. If none exist, the original dataframe is returned

Usage

conditional_drop(data, cols)

Arguments

data

Data frame

cols

Character vector with names of one or more columns to drop

Details

Used in scripts: Robust function: FALSE

Value

conditional_drop returns the data frame without those columns that do exist.


AndreSjuve/dretools documentation built on Dec. 4, 2024, 3:12 a.m.