R/setClasses.R

Defines functions setClasses

Documented in setClasses

#' A wrapper for \code{class(x) = classes}.
#'
#' @param x [any]\cr
#'   Your object.
#' @param classes [\code{character}]\cr
#'  New classes.
#' @return Changed object \code{x}.
#' @export
#' @examples
#' setClasses(list(), c("foo1", "foo2"))
setClasses = function(x, classes) {
  class(x) = classes
  x
}

Try the BBmisc package in your browser

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

BBmisc documentation built on Sept. 29, 2022, 5:12 p.m.