A pipe-friendly wrapper for dim(x) <- NULL and dimnames(x) <- NULL or, if which_dim is not NULL, dimnames(x)[which_dim] <- list(NULL)

drop_dimnames(x, which_dim = NULL, keep_axis_names = FALSE)

drop_dim(x)

drop_dim2(x)

Arguments

x

an object, potentially with dimnames

which_dim

If NULL (the default) then all dimnames are dropped. If integer vector, then dimnames only at the specified dimensions are dropped.

keep_axis_names

TRUE or FALSE, whether to preserve the axis names when dropping the dimnames