Title: | Functional Help for Functions, Objects, and Packages |
---|---|
Description: | Enhance R help system by fuzzy search and preview interface, pseudo-postfix operators, and more. The `?.` pseudo-postfix operator and the `?` prefix operator displays documents and contents (source or structure) of objects simultaneously to help understanding the objects. The `?p` pseudo-postfix operator displays package documents, and is shorter than help(package = foo). |
Authors: | Atsushi Yasumoto [aut, cph, cre] |
Maintainer: | Atsushi Yasumoto <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.6.0 |
Built: | 2024-11-07 02:41:00 UTC |
Source: | https://github.com/atusy/felp |
?
operatorDisplays help and structure of an object, or help of a package.
Two syntax sugars are added to enhance utils::?
.
One is object?.
which works as if ?object
.
Another is package?p
which works as if help(package = package)
`?`(e1, e2)
`?`(e1, e2)
e1 |
A topic of document.
Refer to |
e2 |
|
# Identical to help(identity); print(identity) ?identity identity?. # The same # Identical to help(iris); str(iris) ?iris iris?. # The same # Identical to help(package = stats) stats?p
# Identical to help(identity); print(identity) ?identity identity?. # The same # Identical to help(iris); str(iris) ?iris iris?. # The same # Identical to help(package = stats) stats?p
A dummy data for felp
dummy
dummy
An object of class list
of length 2.
Structure of object is returned by str()
.
For a function, its source is returned instead of str()
.
felp(topic, package = NULL, ...)
felp(topic, package = NULL, ...)
topic |
usually, a name or character string specifying the topic for which help is sought. A character string (enclosed in explicit single or double quotes) is always taken as naming a topic. If the value of See ‘Details’ for what happens if this is omitted. |
package |
a name or character vector giving the packages to look
into for documentation, or |
... |
Arguments passed on to
|
# Identical to help(identity); print(identity) felp(identity) # Identical to help(iris); str(iris) felp(iris) # Identical to help(package = stats) felp(package = stats)
# Identical to help(identity); print(identity) felp(identity) # Identical to help(iris); str(iris) felp(iris) # Identical to help(package = stats) felp(package = stats)
Users no longer have to remember the exact name to find help, vignettes,
and demo.
A shiny gadget helps you to find a topic fuzzily.
Click radio buttons to switch preview contents.
Click "Done" or "Cancel" to close the widget.
When background = FALSE
, the "Done" button will also hook help
,
vignette
, or demo
, accordingly.
fuzzyhelp( query = "", method = getOption("fuzzyhelp.method", "fzf"), background = getOption("fuzzyhelp.background", TRUE), viewer = shiny::paneViewer() )
fuzzyhelp( query = "", method = getOption("fuzzyhelp.method", "fzf"), background = getOption("fuzzyhelp.background", TRUE), viewer = shiny::paneViewer() )
query |
An initial query to search for the help system. |
method |
A fuzzy match method to use. Choices are "fzf" and "lv"
(levenstein). The method "lv" is faster but can be less accurate. The
default value can be tweaked by |
background |
Whether to run a shiny gadget in a background process.
The default value is |
viewer |
Specify where the gadget should be displayed–viewer pane,
dialog window, or external browser–by passing in a call to one of the
|
If the background
argument is TRUE
, then the return value inherits from
callr::r_bg()
. Otherwise, NULL
is returned.
The default fuzzy match algorithm is a simplified version of https://github.com/junegunn/fzf. The implementation in this package excludes bonuses from relationship with matched characters and their previous characters.
if (FALSE) { fuzzyhelp() }
if (FALSE) { fuzzyhelp() }