[Bioc-devel] Creating a package, Error in match.arg(units)

Martin Morgan mtmorgan at fhcrc.org
Wed Aug 26 04:46:31 CEST 2009


Hi Sébastien --

Sébastien Laigre wrote:
> Hi Martin,
> 
> Thank you for helping me.
> I just tried to create a new R session, but it doesn't work so much. I
> also tried to load files one by one using your 2 code lines, but there
> are dependancies problems including files files ar not loaded in the
> right order.

it is not too hard to figure out how to load all the packages, e.g.,
following the sequence listed in the 00install.out output, below.

> In fact, I managed to check & build the package a few time ago, but it
> doesn't work now. I had the right methodology, but I can't know what has
> changed (sorry). My methodolgy is :
> 1. Create the package skeleton with package.build(...) in R console.

Perhaps it would help to review the manual 'Writing R Extensions' so
that you can get an understanding of what various files are?

> 2. Fill R documentation files in the man folder in skeleton, NAMESPACE
> and DESCRIPTION files
> 3. Execute "Rcmd check c:/base/MyApp" with cmd.exe (located in R/bin folder)
> 4. Execute "Rcmd build c:/base/MyApp" with cmd.exe (located in R/bin folder)

Usually you want to do Rcmd build ... and then Rcmd check ....

Make sure that there are no 'hidden' files (starting with a '.') in any
of the folders in c:/base/MyApp/.

I don't really have other suggestions, other than to try to narrow down
where in your package the error occurs, e.g., by temporarily renaming
one file after the other in the MyApp/R directory.

Martin

> 5. Execute "Rcmd INSTALL MyApp.tar.gz" with cmd.exe (located in R/bin
> folder)
> 
> The error occurs when executing check command, here it is the full
> install00.out :
> 
> Le chargement a nécessité le package : tcltk
> Chargement de Tcl/Tk... terminé
> Le chargement a nécessité le package : Hmisc
> Attachement du package : 'Hmisc'
> 
>     The following object(s) are masked from package:base :
> 
>      format.pval,
>      round.POSIXt,
>      trunc.POSIXt,
>      units

> Le chargement a nécessité le package : R2HTML
> Le chargement a nécessité le package : svMisc
> 
> *** 'hhc.exe' introuvable : l'aide CHM ne peut être générée
> 
> * Installing *source* package 'MyApp' ...
> ** R
> ** preparing package for lazy loading
> Loading required package: grid
> Loading required package: reshape
> Loading required package: plyr
> 
> Attaching package: 'plyr'
> 
>     The following object(s) are masked from package:Hmisc :
> 
>      is.discrete,
>      summarize
> 
> 
> Attaching package: 'ggplot2'
> 
>     The following object(s) are masked from package:grid :
> 
>      nullGrob
> 
> 
> Attaching package: 'xtable'
> 
>     The following object(s) are masked from package:Hmisc :
> 
>      label,
>      label<-
> 
> Error in match.arg(units) :
>   'arg' should be one of "secs", "mins", "hours", "days"
> Error : unable to load R code in package 'MyApp'
> ERREUR : lazy loading failed pour le package 'MyApp'
> * Removing 'C:/PROGRA~1/R/R-29~1.1/bin/MYAPP~1.RCH/MyApp'
> 
> 
> 
> Thank you again for you help.
> 
> 
> 
> Sébastien
> 
> 
> 
> 2009/8/25 Martin Morgan <mtmorgan at fhcrc.org <mailto:mtmorgan at fhcrc.org>>
> 
>     Sébastien Laigre wrote:
> 
>         Hello everybody,
> 
>         I have got several S4 classes for my R application, and I'm
>         trying to create
>         a package to deal it easier. It runs on windows XP.
> 
>         So I make :
> 
>           - a package.build(........) to build the skeleton of the package.
>           - Rcmd check c:/base/MyApp
> 
>         But, checking whether package 'MyApp' can be installed, I have
>         the following
>         error (in the install.out file) :
>         Error in match.arg(units) :
>          'arg' should be one of "secs", "mins", "hours", "days"
> 
>         I already encountered this kind error, and adding
>         "importFrom("package",
>         "function") " in the NAMESPACE file solved it.
>         But the match.arg function is in the base package and I can not
>         do that.
> 
>         Can anyone help me please ? Does anybody knows what can it be
>         due to ?
> 
> 
>     Have you tried to start a new R session
> 
>      R --vanilla
> 
>     and then source each of the files in the 'R' directory of the
>     package, along the lines of
> 
>      fls = list.files("c:/base/MyApp/R", full=TRUE)
>      for (f in fls) { cat(f, "\n"); source(f) }
> 
>     ? Or can you provide more information about where during the
>     installation the error message is generated? Please also include
>     sessionInfo().
> 
>     Martin
> 
> 
>         Thank you in advance.
> 
> 
>         Sebastien
> 
>                [[alternative HTML version deleted]]
> 
>         _______________________________________________
>         Bioc-devel at stat.math.ethz.ch
>         <mailto:Bioc-devel at stat.math.ethz.ch> mailing list
>         https://stat.ethz.ch/mailman/listinfo/bioc-devel
> 
> 
> 
>     -- 
>     Martin Morgan
>     Computational Biology / Fred Hutchinson Cancer Research Center
>     1100 Fairview Ave. N.
>     PO Box 19024 Seattle, WA 98109
> 
>     Location: Arnold Building M1 B861
>     Phone: (206) 667-2793
> 
>



More information about the Bioc-devel mailing list