R/chkclass.R

Defines functions chkclass

chkclass <- function(x, class, name = NULL) {
  ## Based on chkclass() from R package meta, version 4.11-0
  
  ##
  ## Check class of R object
  ##
  if (is.null(name))
    name <- deparse(substitute(x))
  ##
  if (!inherits(x, class))
    stop("Argument '", name,
         "' must be an object of class \"",
         class, "\".", call. = FALSE)
  ##
  invisible(NULL)
}

Try the metarep package in your browser

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

metarep documentation built on Jan. 30, 2026, 1:07 a.m.