I agree that require makes it clearer what happens, so I will probably
change. The disadvantage is the (for some users confusing)
messages/warnings if the package is not installed. Wrapping it in with
suppressWarnings and suppressMessages before reprinting the load message
solves that though:
if ("pkg1" %in% rownames(utils:::installed.packages()) ) {
library(pkg1)
...
}
can be replaced by:
if (require("pkg1")) {
...
}
/Henrik
On Thu, Jul 2, 2009 at 5:29 AM, Jon Olav Skoien wrote:
> Hi Seth,
>
> And thanks for your suggestion! I was not able to do exactly what you
> described (
Hi Seth,
And thanks for your suggestion! I was not able to do exactly what you
described (I have no earlier experience with using environments), but
you mentioning .onLoad was a good starting point. I have now removed all
references to pkg1 from the NAMESPACE, and wrote the following .onLoad
Hi Jon,
* On 2009-06-30 at 15:27 +0200 Jon Olav Skoien wrote:
> I work on two packages, pkg1 and pkg2 (in two different projects). pkg1 is
> quite generic, pkg2 tries to solve a particular problem within same field
> (geostatistics). Therefore, there might be users who want to use pkg2 as an
>
Hi,
I have already asked a similar question twice without response on the
r-help list https://stat.ethz.ch/pipermail/r-help/2009-June/200300.html
but this list might be more appropriate. If there is a particular reason
for the lacking answers (unclear, missing information, the solution is
obvi