[IPSUR-commits] r201 - pkg/RcmdrPlugin.IPSUR/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Sep 16 16:13:05 CEST 2011
Author: gkerns
Date: 2011-09-16 16:13:05 +0200 (Fri, 16 Sep 2011)
New Revision: 201
Modified:
pkg/RcmdrPlugin.IPSUR/R/First.r
Log:
deleted firstlib and added onattach
Modified: pkg/RcmdrPlugin.IPSUR/R/First.r
===================================================================
--- pkg/RcmdrPlugin.IPSUR/R/First.r 2011-04-22 12:56:24 UTC (rev 200)
+++ pkg/RcmdrPlugin.IPSUR/R/First.r 2011-09-16 14:13:05 UTC (rev 201)
@@ -4,15 +4,16 @@
# can be included in any Rcmdr plug-in package to cause the package to load
# the Rcmdr if it is not already loaded
-.First.lib <- 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()
- }
- }
-
+
+.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()
+ }
+}
+
More information about the IPSUR-commits
mailing list