do.call method within namespace

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

do.call method within namespace

Paul Roebuck
How does one go about invoking a method within a namespaced
package if that package has not been loaded via library
method?

Given "mypackage" and method "foo" within:
    mypackage::foo(1, 2, 3)

Executing the same method's function call:
    do.call("foo", list(1, 2, 3))

didn't work. Nor did the following:
    do.call("mypackage::foo", list(1, 2, 3))

There some other means to do this without loading the
package via library method?

----------------------------------------------------------
SIGSIG -- signature too long (core dumped)

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: do.call method within namespace

Uwe Ligges
Paul Roebuck wrote:

> How does one go about invoking a method within a namespaced
> package if that package has not been loaded via library
> method?
>
> Given "mypackage" and method "foo" within:
>     mypackage::foo(1, 2, 3)
>
> Executing the same method's function call:
>     do.call("foo", list(1, 2, 3))
>
> didn't work. Nor did the following:
>     do.call("mypackage::foo", list(1, 2, 3))
>
> There some other means to do this without loading the
> package via library method?



do.call(getFromNamespace("foo", "mypackage"), list(1, 2, 3))

   where "mypackage" is a namespace...


Uwe Ligges



> ----------------------------------------------------------
> SIGSIG -- signature too long (core dumped)
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html