screen_masked_imports: Avoid clashing package imports

screen_masked_importsR Documentation

Avoid clashing package imports

Description

Suppose your package imports various other packages. Despite the pious advice about only selectively importing certain functions, it's perfectly fine and very convenient to just be able to import(otherpack) in your NAMESPACE (or the equivalent, in whatever system you use to auto-generate the NAMESPACE). One annoyance, though, is that several packages may export different things with the same name, which leads to disconcerting warnings about "replacing import..." when your package is loaded. This can be circumvented in NAMEPACE using this syntax:

But you sure don't want to have to work out those NAMESPACE details yourself, so this function does it for you.

Mostly, this function will be called invisibly during make.NAMESPACE during pre.install, but you could try it yourself for more manual things.

Usage

screen_masked_imports( imports, myfuns)

Arguments

imports

names of packages that yours imports (or Depends on)

myfuns

functions in your package. You don't want to import other functions with the same name, because those imports will just be overridden.

Value

List of character vectors, one element per imports, saying which if any functions exported by that importee should not be imported via your NAMESPACE.


mvbutils documentation built on May 25, 2026, 5:09 p.m.