[R] R-Commander plug-in difficulties

Prof Brian Ripley ripley at stats.ox.ac.uk
Mon Feb 15 11:37:07 CET 2010


Your package (RcmdrPlugin.MAc on CRAN) does not depend on Rcmdr.  I 
suppose you mean the getRcmdr in Rcmdr, and that will be not available 
when your package is loaded in a vanilla session.

My guess is that you intended such a dependence (in the Depends line 
in the DESCRIPTION file).  It passed the checks because the line

   if (!interactive()) return()

ensured that they did nothing at all.  I am also guessing that you
did manual checks in an interactive session with Rcmdr already loaded.

On Mon, 15 Feb 2010, AC Del Re wrote:

> Hi All,
>
> I have recently created an Rcmdr plugin package and it passed all the
> checks and was uploaded to CRAN. I then downloaded it from CRAN and
> tried running it from my local R program and received this error:
>
> ...
> Error in f(libname, pkgname) : could not find function "getRcmdr"
> Error in library(pkg, character.only = TRUE) :
>  .First.lib failed for 'RcmdrPlugin.MAc'
>
>
> In my .R file with all the relevant functions that are read into the
> package, I have placed this at the top, which seems to be related to
> one of the sources of error (?):
>
> .packageName <- "RcmdrPlugin.MAc"
>
> .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()
> }
> }
>
>
> I am not exactly sure how to proceed--I appreciate any suggestions.
>
> AC

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list