inst/source/R/strip_off_attributes.R

#' Strip Attributes off an Object
#'
#' @param x An object.
#' @return The object.
#' @family bits and pieces
#' @seealso \code{\link[base:unname]{base::unname}}
#' @export
#' @examples
#' y <- stats::setNames(1:3, letters[1:3])
#' attr(y, "myattr") <- "qwer"
#' comment(y) <- "qwer"
#' strip_off_attributes(y)
strip_off_attributes <- function(x) {
    attributes(x) <- NULL
    return(x)
}

Try the fritools2 package in your browser

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

fritools2 documentation built on July 9, 2023, 7:07 p.m.