[Rd] Package installation and path.package

Simon Zehnder szehnder at uni-bonn.de
Tue Sep 10 17:54:05 CEST 2013


Hi Dirk,

thanks for the help I take a more thorough look at it. 

Best

Simon

On Sep 9, 2013, at 3:41 PM, Dirk Eddelbuettel <edd at debian.org> wrote:

> 
> On 9 September 2013 at 09:26, Simon Urbanek wrote:
> | On Sep 9, 2013, at 4:22 AM, Simon Zehnder wrote:
> | > I am writing right now my own package that makes use of 'tempfile' and
> | > there within with 'path.package'. When I install it, I get the error: Error
> | > in path.package("mypackage") : none of the packages are loaded. Here is the
> | > code, I use in my package:
> [...]
> | That path to your package is dynamic - in general it will not be know when
> | creating the lazy-load DB, so you really want to put that code in .onLoad()
> | where the path is known. 
> 
> And you may want to use   system.file()   rather than path.package(), at
> least if I understand the question right.
> 
> Here is what I use to share the bibtex file for the Rcpp vignettes with other
> Rcpp* package vignettes:
> 
>   R> system.file(package="Rcpp", "doc", "Rcpp.bib")
>   [1] "/usr/local/lib/R/site-library/Rcpp/doc/Rcpp.bib"
>   R> 
> 
> Answer conditional on my particular Linux system, but the path is guaranteed
> to be valid as long as Rcpp is installed which one can ensure via Depends:
> from another package.
> 
> Dirk
> 
> -- 
> Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com



More information about the R-devel mailing list