Skip to content
Prev 39238 / 63424 Next

function call overhead

Hi Paul,
function (pkg, name)
{
    pkg <- as.character(substitute(pkg))
    name <- as.character(substitute(name))
    get(name, envir = asNamespace(pkg), inherits = FALSE)
}
<environment: namespace:base>

and
function (pkg, name)
{
    pkg <- as.character(substitute(pkg))
    name <- as.character(substitute(name))
    ns <- tryCatch(asNamespace(pkg), hasNoNamespaceError = function(e) NULL)
    if (is.null(ns)) {
        pos <- match(paste("package", pkg, sep = ":"), search(),
            0L)
        if (pos == 0)
            stop(gettextf("package %s has no name space and is not on
the search path"),
                sQuote(pkg), domain = NA)
        get(name, pos = pos, inherits = FALSE)
    }
    else getExportedValue(pkg, name)
}
<environment: namespace:base>


are the reasons I think.

Jeff

On Wed, Feb 16, 2011 at 12:13 PM, Paul Gilbert
<pgilbert at bank-banque-canada.ca> wrote: