Re: [Rd] Using requireNamespace() instead of require()

2014-09-28 Thread Prof Brian Ripley
On 28/09/2014 14:09, Duncan Murdoch wrote: On 28/09/2014, 8:47 AM, Viechtbauer Wolfgang (STAT) wrote: Suppose I have a function funcA() in package pkgA that requires function funcB() from another package pkgB under certain circumstances. Those circumstances are rare though, so I put package pk

Re: [Rd] Using requireNamespace() instead of require()

2014-09-28 Thread Duncan Murdoch
On 28/09/2014, 8:47 AM, Viechtbauer Wolfgang (STAT) wrote: > Suppose I have a function funcA() in package pkgA that requires function > funcB() from another package pkgB under certain circumstances. Those > circumstances are rare though, so I put package pkgB under 'Suggests', and > use this in

[Rd] Using requireNamespace() instead of require()

2014-09-28 Thread Viechtbauer Wolfgang (STAT)
Suppose I have a function funcA() in package pkgA that requires function funcB() from another package pkgB under certain circumstances. Those circumstances are rare though, so I put package pkgB under 'Suggests', and use this in funcA() when those circumstances do arise: if (require("pkgB", qui