R/S3.R

Defines functions make_is

# nocov start
make_is <- function(class, env = parent.frame()) {
  f <- eval(bquote(function(x) {
    inherits(x, .(class))
  }))
  environment(f) <- env
  f
}

make_new <- function(class, env = parent.frame()) {
  f <- eval(bquote(function(x = list(), ...) {
    structure(x, ..., class = .(class))
  }))
  environment(f) <- env
  f
}

default_print <- function(x, ...) {
  cat(format(x, ...), sep = "\n")
  invisible(x)
}
# nocov end

Try the mlfit package in your browser

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

mlfit documentation built on Oct. 8, 2021, 9:09 a.m.