Skip to content
Prev 265 / 12125 Next

[R-pkg-devel] Help needed to setting custom packages for R 3.1.2

On 15/07/2015 9:07 AM, sbihorel wrote:
I haven't been following this thread, but the 2nd para above makes it
sound as though an explanation of the NAMESPACE directives would be helpful.

If you say

 importFrom(Hmisc, latex)

it acts as though you have made a copy of the Hmisc::latex function
within your package environment.  (It isn't exported, unless you ask to
export it.)

If you say

 import(Hmisc)

it acts as though you have made copies of every exported function from
Hmisc within your package environment.  This is why we recommend
importing only the functions you need; otherwise your package
environment gets bloated.

No recursive copies are made, unless Hmisc happens to import something
and re-exports it.

When I say "acts as though", I don't mean it literally makes copies; it
implements this in a more efficient way, basically only copying pointers
to those functions -- but from a user point of view, you shouldn't be
able to tell the difference, since you're not allowed to modify
Hmisc::latex.

Duncan Murdoch