[Rcpp-devel] Bug: RcppArmadillo.package.skeleton builds faulty man/*.Rd files

Nathan VanHoudnos nathanvan at gmail.com
Wed Jul 11 23:07:01 CEST 2012


Hi all,

Is the appropriate place to report bugs, or should I send this somewhere
else?

I'm using:

Package: RcppArmadillo
Version: 0.3.2.3
Date: $Date: 2012-06-29 20:51:46 -0500 (Fri, 29 Jun 2012) $


Minimal example:

    #############################
    # File : build-R-pacakge.R  #
    #############################
    require(inline)
    require(Rcpp)
    require(RcppArmadillo)

    # Define a simple cxxfunction
    plus.two.cpp.src <- '
        arma::mat U = Rcpp::as<arma::mat>(UmatrixR);
        return(Rcpp::wrap(U+2));
    '
    plus.two.cpp <- cxxfunction(
                 signature(UmatrixR="numeric"),
                 body=plus.two.cpp.src,
                 plugin="RcppArmadillo")

    # Define the analogous R funtion
    plus.two.r <- function( x ) {
      return( x + 2 )
    }


## Step 2: Run RcppArmadillo.package.skeleton
In new R session run:

    source('build-R-package.R')
    RcppArmadillo.package.skeleton(name='inlineExample',
                     list=c('plus.two.cpp', 'plus.two.r'),
                     code_files='build-R-package.R')

## Step 3: Run R CMD build ##
Run

    $ R CMD build inlineExample/

which successfully builds `inlineExample_1.0.tar.gz`.

## Step 4: Run R CMD check ##

It fails.

    $ R CMD check inlineExample_1.0.tar.gz
    << snip >>
    * checking whether package ‘inlineExample’ can be installed ... ERROR
    Installation failed.
    See ‘/home/nathanvan/example/inlineExample.Rcheck/00install.out’ for
details.

and the "detail" output:

$ cat inlineExample.Rcheck/00install.out
* installing *source* package ‘inlineExample’ ...
<< snip >>
** R
** preparing package for lazy loading
** help
Warning:
/home/nathanvan/example/inlineExample.Rcheck/00_pkg_src/inlineExample/man/inlineExample-package.Rd:33:
All text must be in a section
Warning:
/home/nathanvan/example/inlineExample.Rcheck/00_pkg_src/inlineExample/man/inlineExample-package.Rd:34:
All text must be in a section
*** installing help indices
Error in Rd_info(db[[i]]) :
  missing/empty \title field in
'/home/nathanvan/example/inlineExample.Rcheck/00_pkg_src/inlineExample/man/plus.two.cpp.Rd'
Rd files must have a non-empty \title.
See chapter 'Writing R documentation' in manual 'Writing R Extensions'.
* removing ‘/home/nathanvan/example/inlineExample.Rcheck/inlineExample’


A work around is to simply delete the man/*.Rd files. Then it works.

For example:

$ rm inlineExample/man/*.Rd
$ R CMD build inlineExample
$ R CMD check inlineExample

works fine, although it complains about missing the documentation. (If I
knew how to read *.Rd files, I might be able to point out precisely what is
wrong, but they are a bit of mystery to me.)


Cheers,
-- 
Nathan VanHoudnos
|- Statistics & Public Policy PhD student
|- Program for Interdisciplinary Education Research (PIER) Fellowship
|- Carnegie Mellon University
|- http://www.andrew.cmu.edu/user/nmv

"We may at once admit that any inference from the particular to the
 general must be attended with some degree of uncertainty, but this
 is not the same as to admit that such inference cannot be absolutely
 rigorous, for the nature and degree of the uncertainty may itself be
 capable of rigorous expression."  -- R.A. Fisher
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20120711/cebbd2bf/attachment.html>


More information about the Rcpp-devel mailing list