[Rd] evaluation in unattached namespace
deepayan.sarkar at gmail.com
Fri Apr 27 01:39:01 CEST 2007
I recently discovered this buglet in lattice: If lattice is _not_
attached, I get
Error in eval(expr, envir, enclos) : could not find function "bwplot"
This happens because of this:
function (x, data = NULL, panel = "panel.dotplot", ...)
ocall <- ccall <- match.call()
ccall$data <- data
ccall$panel <- panel
ccall[] <- as.name("bwplot")
ans <- eval.parent(ccall)
ans$call <- ocall
That is, ccall is eval()-ed in the global environment where bwplot is
not visible. While this example is somewhat silly, similar things
happen when I try to import lattice from another package.
Are there any simple alternatives? I tried
ccall[] <- as.name("lattice::bwplot")
but that didn't work either.
More information about the R-devel