rticulate / import

An Import Mechanism For R
https://import.rticulate.org
Other
222 stars 14 forks source link

Retain documentation linkage for aliased functions #1

Closed leeper closed 7 years ago

leeper commented 9 years ago

I'm assuming you've seen this SO question?

My answer there led me to realize that maintaining accessible documentation when creating a function alias is really hard. I'd love to see a solution for this inside this package so as to avoid the following:

> import::from(dplyr, select, arrange, keep_when = filter)
> ? keep_when
No documentation for ‘keep_when’ in specified packages and libraries:
you could try ‘??keep_when’
smbache commented 9 years ago

I am not sure there is a good solution to this within the scope of this package; not one that come immediately to my mind anyways. It is a good point, however.

krlmlr commented 9 years ago

devtools already overrides help and ? -- a clean solution would be a package that does the same but supports more generic hooks, which devtools and import and perhaps others could use.

smbache commented 8 years ago

Made a small solution for this via https://github.com/smbache/import/commit/0c2cb834b686f567349420345a86f5bd43a108ac

it places a ? function in the imports entry in the search path, and redirects if the symbol is an import. Otherwise, it redirects to utils::?.