R/remove_column.R

#' @include AllGenerics.R AllClasses.R
NULL

#' @describeIn remove_column Remove columns to any slot
#' @export
setMethod("remove_column",
    signature = signature(
        object = "TidySet",
        slot = "character",
        column_names = "character"
    ),
    function(object, slot, column_names) {
        original <- slot(object, slot)
        remove <- colnames(original) %in% column_names
        slot(object, slot) <- original[, !remove]
        object
    }
)

Try the BaseSet package in your browser

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

BaseSet documentation built on April 12, 2025, 2:25 a.m.