.onLoad <- function(...) {
register_s3_method("stats", "coef", "ml_analysis")
register_s3_method("stats", "logLik", "ml_analysis")
invisible()
}
register_s3_method <- function(pkg, generic, class) {
stopifnot(is.character(pkg), length(pkg) == 1)
stopifnot(is.character(generic), length(generic) == 1)
stopifnot(is.character(class), length(class) == 1)
fun <- get(paste0(generic, ".", class), envir = parent.frame())
if (pkg %in% loadedNamespaces()) {
registerS3method(generic, class, fun, envir = asNamespace(pkg))
}
setHook(
packageEvent(pkg, "onLoad"),
function(...) {
registerS3method(generic, class, fun, envir = asNamespace(pkg))
}
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.