conflicted icon indicating copy to clipboard operation
conflicted copied to clipboard

help system in conflicted

Open RobinHankin opened this issue 7 years ago • 3 comments

Great package! I am the author of the elliptic package,

https://github.com/RobinHankin/elliptic.git

The package defines a function sd() which is one of a systematic set of functions with names such as sn(), ds(), ss() and so on which means that the name sd() is unalterable. So this creates an unavoidable conflict with base::sd(). What I would like is to have an option to make the help system respect the conflict resolution:

R % R --vanilla --quiet
> library(conflicted)
> library(elliptic)
> conflict_prefer("sd","elliptic")
[conflicted] Will prefer elliptic::sd over any other package
> ?sd
Help on topic ‘sd’ was found in the following packages:

  Package               Library
  stats
/Library/Frameworks/R.framework/Versions/3.5/Resources/library
  elliptic              /Users/rhankin/Library/R/3.5/library

I don't like to have to choose which option I want here: I want to go directly to the elliptic::sd helppage. Is this possible?

RobinHankin avatar Aug 23 '18 23:08 RobinHankin

Oh yes, this is a nice idea. It would require shimming ? (which will be a little tricky to be compatible with devtools), but it's certainly doable.

hadley avatar Aug 23 '18 23:08 hadley

Well... But ?sd also is a fast way to know which are the package environment functions which are in conflict...

So it is only one click away to access the help page for ?sd with conflict_prefer("sd","elliptic") function...

jtelleria avatar Jan 24 '19 09:01 jtelleria

I guess a single click isn't too onerous, especially as the help system is only ever fired up in interactive mode (?). Perhaps a good compromise might be to type ?sd and get a warning that there is a conflict, then fire up the preferred help? ~~~~

RobinHankin avatar Jan 24 '19 18:01 RobinHankin