Learn R Programming

oaii (version 0.5.0)

df_exclude_col: Remove columns from data.frame

Description

Remove columns from data.frame

Usage

df_exclude_col(df, col, on_missing_col = "warn")

Value

Modified input data.frame

Arguments

df

data.frame, input data.frame

col

character vector, column name(s) to be deleted

on_missing_col

string, behavior for missing column(s): "warn" - log warning, "skip" - skip missing column(s), "stop" - throw error

Examples

Run this code
df <- data.frame(a = 1:3, b = 1:3, c = 1:3)
df_exclude_col(df, "b")
df_exclude_col(df, c("a", "c"))

Run the code above in your browser using DataLab