[R] Access function as text from package by name
Deepayan Sarkar
deep@y@n@@@rk@r @end|ng |rom gm@||@com
Fri Sep 28 10:58:58 CEST 2018
On Fri, Sep 28, 2018 at 2:16 PM Bert Gunter <bgunter.4567 using gmail.com> wrote:
>
> Do you mean:
> ?get
Doesn't work with :: etc:
> get("graphics::box")
Error in get("graphics::box") : object 'graphics::box' not found
I think parse()+eval() is pretty much unavoidable. After that, it's a
choice between deparse() and print()+capture.output().
-Deepayan
> On Thu, Sep 27, 2018, 11:44 PM Sigbert Klinke <sigbert using wiwi.hu-berlin.de>
> wrote:
>
> > Hi,
> >
> > I guess I was not clear enough: the name of the function is stored as
> > string. Solutions which use the object directly do not help unfortunately.
> >
> > Thanks Sigbert
> >
> > Am 27.09.2018 um 12:30 schrieb Sigbert Klinke:
> > > Hi,
> > >
> > > I want to have a function, e.g. graphics::box, as text.
> > > Currently I'am using
> > >
> > > deparse(eval(parse(text='graphics::box')))
> > >
> > > It is important that '::' and ':::' can be used in the name.
> > >
> > > Is there a simpler way?
> > >
> > > Thanks
> > >
> > > Sigbert
> > >
> > >
> > >
> > > ______________________________________________
> > > R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > > https://stat.ethz.ch/mailman/listinfo/r-help
> > > PLEASE do read the posting guide
> > http://www.R-project.org/posting-guide.html
> > > and provide commented, minimal, self-contained, reproducible code.
> > >
> >
> >
> > --
> > https://hu.berlin/sk
> > https://hu.berlin/mmstat3
> >
> > ______________________________________________
> > R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> > http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list