[Rd] file.system() in packages

Dirk Eddelbuettel edd at debian.org
Tue Jan 22 03:53:45 CET 2013


Robin,

Rcpp is experimenting with a 'callback' scheme in vignettes.  

For this, Rcpp itself has an unexported function bib() defined as

    bib <- function() {
       sub("\\.bib$", "", system.file( "doc", "Rcpp.bib", package = "Rcpp" ) )
    }

and packages depending on Rcpp can then do this in the vignette header:

    RcppBibfile <- sub("\\.bib$", "", Rcpp:::bib())

which gets used towards the end of the Rnw file as

    \bibliography{\Sexpr{RcppBibfile}}

I think so far only one package is using it.

Hth, Dirk

-- 
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com



More information about the R-devel mailing list