R/remove_repeated_colnames.R

Defines functions remove_repeated_colnames

# A helping function that removes any columns of `exdf_a` that are also in
# `exdf_b`
remove_repeated_colnames <- function(exdf_a, exdf_b) {
    a_in_b <- colnames(exdf_a) %in% colnames(exdf_b)

    a_in_b_names <- colnames(exdf_a)[a_in_b]

    for (cn in a_in_b_names) {
        exdf_a[, cn] <- NULL
    }

    exdf_a
}

Try the PhotoGEA package in your browser

Any scripts or data that you put into this service are public.

PhotoGEA documentation built on April 11, 2025, 5:48 p.m.