Skip to content
Prev 45702 / 63421 Next

as.name and namespaces

Here is an example problem:

 > mycall <- expression(lm(Y ~ x))[[1]]
 > mycall
lm(Y ~ x)
 > newname <- "stats::lm"

 > desiredResult
stats::lm(Y ~ x)

I've solved the problem in the kludgy way of
deparsing, fixing the string and then parsing.

I like Duncan's third method, but it seems like
it assumes the solution.  Moving functions around
is unappetizing for my use -- this is for testing
and keeping things as faithful to real use is a
good thing.

Pat
On 23/04/2013 21:18, Duncan Murdoch wrote: