Skip to contents

Warn message

Usage

warn_var_msg(df, vars, msg)

Arguments

df

The data frame to check for existing variables

vars

A character vector of variable names to check for

msg

The message to print

Details

This function checks if any of the variables in vars are already present in df. If any are found, a warning is issued and the variables will be removed from df.

Examples

df <- data.frame(x = 1, y = 2)
warn_removal(df, c("x", "z"), "Variable(s) will be removed.")
#> Error in warn_removal(df, c("x", "z"), "Variable(s) will be removed."): could not find function "warn_removal"