Check if a data frame has columns that we might overwrite
check_if_overwrite_columns.Rd
Helper function for other functions in the package that create new columns in a data frame, to check if the columns are already present in the data frame.
Details
Produces a warning if the columns are present but overwrite
is true, and
an error if overwrite
is false.
Examples
df <- data.frame(a=c(1,2,3), b=c(1,2,3))
# this should give a warning
check_if_overwrite_columns(df, c('a', 'd'), overwrite=TRUE)
#> Warning: Data frame has columns that are assigned in 'eval'. Overwriting