From edd at debian.org  Tue Jan 22 03:53:45 2013
From: edd at debian.org (Dirk Eddelbuettel)
Date: Mon, 21 Jan 2013 20:53:45 -0600
Subject: [Rd] file.system() in packages
In-Reply-To: <50FDF459.2090809@stats.ox.ac.uk>
References: <CAHHjBM5WffjRPiTMfWcZdMSZ=vLbU0aeoX7nJa+WwsarYessXg@mail.gmail.com>
	<50FDF459.2090809@stats.ox.ac.uk>
Message-ID: <20733.65337.284200.889502@max.nulle.part>


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



[Rd] file.system() in packages
Dirk Eddelbuettel