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

Dirk Eddelbuettel edd at debian.org
Wed Jul 11 23:15:18 CEST 2012


Hi Nathan,

On 11 July 2012 at 17:07, Nathan VanHoudnos wrote:
| Hi all,
| 
| Is the appropriate place to report bugs, or should I send this somewhere else?

Sure is.
 
| 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. 

Can you please a second approach too use RcppArmadillo.package.skeleton()
without the supplied functions and see what happens?  

As I recall, you will get only _warnings_ from R CMD check. Those warnings
are all from the Rd files which R's own package.skeleton() inserts when we
call it. 

I will have a look at the issue with \title later. Maybe there is something I
can fix. 
 
| 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.)

See "Writing R Extensions".

Dirk

| 
| 
| 
| 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
| 
| 
| ----------------------------------------------------------------------
| _______________________________________________
| Rcpp-devel mailing list
| Rcpp-devel at lists.r-forge.r-project.org
| https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
-- 
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com  


More information about the Rcpp-devel mailing list