[R] Modify functions in base packages (needed for completion for proto objects)

Gabor Grothendieck ggrothendieck at gmail.com
Fri Sep 11 16:07:45 CEST 2009


See ?assignInNamespace

On Fri, Sep 11, 2009 at 10:02 AM, Vitalie S. <vitosmail at rambler.ru> wrote:
>
> Hello everyone,
>
> I am trying to implement completion for proto objects. Proto extends
> environment in a hierarchical way. Thus completion should list all the names
> in all it's parent environments.
>
> For "normal" classes defining names.class would do the job, but completion
> for "environment" is  hard coded in utils:::specialCompletions by means of
> base::ls(). As result defining names.proto does not work.
>
> I tried to make "ls" generic and to do something like:
>
> environment(ls.default) <- asNamespace('utils')
> environment(ls) <- asNamespace('utils')
> environment(ls.proto) <- asNamespace('utils')
>
> That does not work either.
>
> Is there a way to make utils:::specialCompletions use my "ls" instead of
> "base::ls"??
>
> I know Deepayan Sarkar is working now on improving the completion system
> (potentially by introducing "completion" generic). That would definitely
> solve the problem. But for now, does a quick fix exist?
>
> Thanks a lot,
> Vitalie
>
> ______________________________________________
> R-help at r-project.org mailing list
> 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