[Rcpp-devel] Sections 5.8.1 and 5.8.2 of Writing R Extensions (LinkingTo)

Dominick Samperi djsamperi at gmail.com
Wed Oct 27 19:22:08 CEST 2010


Hello,

In Sections 5.8.1 and 5.8.2 of Writing R Extensions the following pattern is
suggested
for getting the path to a file in another package:

PKGB_PATH=‘echo ’library(packB); cat(system.file("libs", package="packB"))’
\
| ${R_HOME}/bin/R --vanilla --slave‘

Is the library(packB) really needed here? It is not needed on two systems
that
I have tested: Windows and Linux. What about MacOS?

If loading packB requires loading many other packages or doing expensive
initialization it would be much more efficient if we could omit
library(packB)
here.

On the other hand, keeping library(packB) has one possible advantage,
namely,
it may eliminate the need to add packB.dll to the loader's search path. So
there
is a trade-off of convenience vs efficiency.

Thanks,
Dominick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20101027/68f4654b/attachment.htm>


More information about the Rcpp-devel mailing list