From marc_schwartz at me.com  Wed Feb 12 18:29:38 2014
From: marc_schwartz at me.com (Marc Schwartz)
Date: Wed, 12 Feb 2014 11:29:38 -0600
Subject: [Rd] path.package() versus system.file() for locating installed
 package folders
In-Reply-To: <52FBA9C1.9020707@stats.ox.ac.uk>
References: <0E72299F-E12F-4B64-8399-96B960E12A6C@me.com>
	<52FBA9C1.9020707@stats.ox.ac.uk>
Message-ID: <F4B65696-31EE-4C39-BFC1-E2D0314A9C25@me.com>


On Feb 12, 2014, at 11:05 AM, Prof Brian Ripley <ripley at stats.ox.ac.uk> wrote:

> On 12/02/2014 16:28, Marc Schwartz wrote:
>> Hi all,
>> 
>> For several years, I have used path.package() to get the path to Perl scripts contained within WriteXLS.
>> 
>> I have a request to change this to using system.file(), which would provide the ability to utilize WriteXLS functionality, without having to load the package, which path.package() requires.
>> 
>> Based upon my review of the code, I don't see any obvious down sides to making the change, but wanted to solicit comments from anyone that might challenge the change in the code.
>> 
>> Thanks in advance.
>> 
>> Regards,
>> 
>> Marc Schwartz
> 
> I don't think path.package() ever was the right tool: find.package() looks a closer match, and system.file() is a wrapper for it (which was all that was made available for many years: up to R 2.13.0 AFAIR).


Thanks.

I don't, at this point, recall the history as to why I elected to use path.package(), but my guess is that I looked at some subset of other CRAN packages at the time that also included script files and used them as a model. In hindsight, not the best approach.

Regards,

Marc


> 
> -- 
> Brian D. Ripley,                  ripley at stats.ox.ac.uk
> Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
> University of Oxford,             Tel:  +44 1865 272861 (self)
> 1 South Parks Road,                     +44 1865 272866 (PA)
> Oxford OX1 3TG, UK                Fax:  +44 1865 272595
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] path.package() versus system.file() for locating installed package folders
Marc Schwartz