[R] R CMD check package "mypkg-Ex.R" failed

Uwe Ligges ligges at statistik.tu-dortmund.de
Sat Jun 1 15:01:13 CEST 2013



On 01.06.2013 08:26, Berend Hasselman wrote:
>
> On 01-06-2013, at 02:56, Justin <dlyzxl at yahoo.com> wrote:
>
>> I build a test package in order to publish my own package to bioconductor.
>>
>> I am using package.skeleton
>> Step 1. create test package "mypkg"
>>    f <- function(x,y) x+y
>>    package.skeleton(list=c("f"), name="mypkg")
>>
>> Step 2. build tar.gz file
>>
>> {mars:/local/workspace01/zhangju/R_autopackage_Elbow}../bin/R CMD build mypkg
>> * checking for file ‘mypkg/DESCRIPTION’ ... OK
>> * preparing ‘mypkg’:
>> * checking DESCRIPTION meta-information ... OK
>> * checking for LF line-endings in source and make files
>> * checking for empty or unneeded directories
>> * building ‘mypkg_1.0.tar.gz’
>>
>> Step 3. check compressed package file
>>
>> {mars:/local/workspace01/zhangju/R_autopackage_Elbow}../bin/R CMD check mypkg_1.0.tar.gz
>> * using log directory ‘/local/workspace01/zhangju/R_autopackage_Elbow/mypkg.Rcheck’
>> *
>> using R version 2.14.0 (2011-10-31)
>> * using platform: x86_64-unknown-linux-gnu (64-bit)
>> * using session charset: UTF-8
>> * checking for file ‘mypkg/DESCRIPTION’ ... OK
>> * checking extension type ... Package
>> * this is package ‘mypkg’ version ‘1.0’
>> * checking package namespace information ... OK
>> * checking package dependencies ... OK
>> * checking if this is a source package ... OK
>> * checking if there is a namespace ... OK
>> * checking for executable files ... OK
>> * checking whether package ‘mypkg’ can be installed ... ERROR
>> Installation failed.
>> See ‘/local/workspace01/zhangju/R_autopackage_Elbow/mypkg.Rcheck/00install.out’ for details.
>>
>> Step 4. check error
>>
>> {mars:/local/workspace01/zhangju/R_autopackage_Elbow}head mypkg.Rcheck/00install.out
>> * installing *source* package ‘mypkg’ ...
>> ** R
>> ** preparing package for lazy loading
>> ** help
>> Warning:
>>
>>
>> /local/workspace01/zhangju/R_autopackage_Elbow/mypkg.Rcheck/00_pkg_src/mypkg/man/mypkg-package.Rd:33:
>> All text must be in a section
>> Warning:
>> /local/workspace01/zhangju/R_autopackage_Elbow/mypkg.Rcheck/00_pkg_src/mypkg/man/mypkg-package.Rd:34:
>> All text must be in a section
>> *** installing help indices
>> Error in Rd_info(db[[i]]) :
>>    missing/empty \title field in '/local/workspace01/zhangju/R_autopackage_Elbow/mypkg.Rcheck/00_pkg_src/mypkg/man/f.Rd'
>> Rd files must have a non-empty \title.
>>
>> Step 5. add "test package" to the title of f.Rd
>> Step 6. build again
>>
>> {mars:/local/workspace01/zhangju/R_autopackage_Elbow}../bin/R CMD build mypkg
>> * checking for file ‘mypkg/DESCRIPTION’ ... OK
>> * preparing ‘mypkg’:
>> * checking DESCRIPTION meta-information ... OK
>> * checking for LF line-endings in source and make files
>> * checking for empty or unneeded directories
>> * building ‘mypkg_1.0.tar.gz’
>>
>> Step 7.
>> check compressed package again
>>
>> {mars:/local/workspace01/zhangju/R_autopackage_Elbow}../bin/R CMD check mypkg_1.0.tar.gz
>> * using log directory ‘/local/workspace01/zhangju/R_autopackage_Elbow/mypkg.Rcheck’
>> * using R version 2.14.0 (2011-10-31)
>> * using platform: x86_64-unknown-linux-gnu (64-bit)
>> * using session charset: UTF-8
>> * checking for file ‘mypkg/DESCRIPTION’ ... OK
>> * checking extension type ... Package
>> * this is package ‘mypkg’ version ‘1.0’
>> * checking package namespace information ... OK
>> * checking package dependencies ... OK
>> * checking if this is a source package ... OK
>> * checking if there is a namespace ... OK
>> * checking for executable files ... OK
>> * checking whether package ‘mypkg’ can be installed ... WARNING
>> Found the following significant warnings:
>>    Warning: /local/workspace01/zhangju/R_autopackage_Elbow/mypkg.Rcheck/00_pkg_src/mypkg/man/mypkg-package.Rd:33: All
>> text must be in a section
>>    Warning:
>> /local/workspace01/zhangju/R_autopackage_Elbow/mypkg.Rcheck/00_pkg_src/mypkg/man/mypkg-package.Rd:34:
>> All text must be in a section
>> See ‘/local/workspace01/zhangju/R_autopackage_Elbow/mypkg.Rcheck/00install.out’ for details.
>> * checking installed package size ... OK
>> * checking package directory ... OK
>> * checking for portable file names ... OK
>> * checking for sufficient/correct file permissions ... OK
>> * checking DESCRIPTION meta-information ... WARNING
>> Non-standard license specification:
>>    What license is it under?
>> Standardizable: FALSE
>> * checking top-level files ... OK
>> * checking index information ... OK
>> * checking package subdirectories ... OK
>> * checking R files for non-ASCII characters ... OK
>> * checking R files for syntax errors ... OK
>> * checking whether the package can be loaded ... OK
>> * checking whether the package can be loaded with stated
>> dependencies ... OK
>> * checking whether the package can be unloaded cleanly ... OK
>> * checking whether the namespace can be loaded with stated dependencies ... OK
>> * checking whether the namespace can be unloaded cleanly ... OK
>> * checking for unstated dependencies in R code ... OK
>> * checking S3 generic/method consistency ... OK
>> * checking replacement functions ... OK
>> * checking foreign function calls ... OK
>> * checking R code for possible problems ... OK
>> * checking Rd files ... WARNING
>> prepare_Rd: f.Rd:7-9: Dropping empty section \description
>> prepare_Rd: f.Rd:22-24: Dropping empty section \details
>> prepare_Rd: f.Rd:25-31: Dropping empty section \value
>> prepare_Rd: f.Rd:38-40: Dropping empty section \note
>> prepare_Rd: f.Rd:35-37: Dropping empty section \author
>> prepare_Rd: f.Rd:32-34: Dropping empty section \references
>> prepare_Rd: f.Rd:44-46: Dropping empty section \seealso
>> checkRd: (5) f.Rd:0-60: Must have a
>> \description
>> prepare_Rd: mypkg-package.Rd:33: All text must be in a section
>> prepare_Rd: mypkg-package.Rd:34: All text must be in a section
>> * checking Rd metadata ... OK
>> * checking Rd cross-references ... WARNING
>> Unknown package(s) ‘<pkg>’ in Rd xrefs
>> * checking for missing documentation entries ... OK
>> * checking for code/documentation mismatches ... OK
>> * checking Rd \usage sections ... OK
>> * checking Rd contents ... OK
>> * checking for unstated dependencies in examples ... NOTE
>> Warning: parse error in file ‘mypkg-Ex.R’:
>> 11: unexpected symbol
>> 42:
>> 43: " ~~ simple examples
>>                ^
>> * checking examples ... ERROR
>> Running examples in ‘mypkg-Ex.R’ failed
>> The error most likely occurred in:
>>
>>> ### Name: mypkg-package
>>> ### Title: What the package does (short line) ~~ package title ~~
>>> ### Aliases:
>> mypkg-package mypkg
>>> ### Keywords: package
>>>
>>> ### ** Examples
>>>
>>> ~~ simple examples of the most important functions ~~
>> Error: unexpected symbol in "~~ simple examples"
>> Execution halted
>>
>>
>> My question: How to correct the above error?
>>
>
> How about making a working example replacing " ~~ simple examples"?
> Have you tried entering the text " ~~ simple examples" (without the quotes) in R and looked at the error message you get?


Right, The Rd files generated from package.skeleton do not work right 
away, you need to remove those comments and fill it content.
This is by design and on prupose to force package developers to work on 
the documentation.

Best,
Uwe Ligges

> Berend
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list