Marc Schwartz
2014-Feb-12 16:28 UTC
[Rd] path.package() versus system.file() for locating installed package folders
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
Prof Brian Ripley
2014-Feb-12 17:05 UTC
[Rd] path.package() versus system.file() for locating installed package folders
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 SchwartzI 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). -- 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