R/RcmdrPlugin.TeachingDemos.R

Defines functions onAttach

# Some Rcmdr dialogs for the TeachingDemos package

# last modified: 2012-08-28 by J. Fox

# Note: the following function (with contributions from Richard Heiberger) 
# can be included in any Rcmdr plug-in package to cause the package to load
# the Rcmdr if it is not already loaded

.onAttach <- function(libname, pkgname){
    if (!interactive()) return()
    Rcmdr <- options()$Rcmdr
    plugins <- Rcmdr$plugins
    if ((!pkgname %in% plugins) && !getRcmdr("autoRestart")) {
        Rcmdr$plugins <- c(plugins, pkgname)
        options(Rcmdr=Rcmdr)
        closeCommander(ask=FALSE, ask.save=TRUE)
        Commander()
    }
}

Try the RcmdrPlugin.SM package in your browser

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

RcmdrPlugin.SM documentation built on May 30, 2017, 5:22 a.m.