From szehnder at uni-bonn.de  Tue Sep 10 17:54:05 2013
From: szehnder at uni-bonn.de (Simon Zehnder)
Date: Tue, 10 Sep 2013 17:54:05 +0200
Subject: [Rd] Package installation and path.package
In-Reply-To: <21037.53270.901095.347497@max.nulle.part>
References: <79265780-D119-450A-93F9-D5BA2A81C9B1@uni-bonn.de>
	<D2208CD6-8CA6-4A21-A112-9CE4E3BA1587@r-project.org>
	<21037.53270.901095.347497@max.nulle.part>
Message-ID: <8430D34F-DA7F-4C89-AB05-D4047CABBDD6@uni-bonn.de>

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



[Rd] Package installation and path.package
Simon Zehnder