Type: | Package |
Title: | Functional Help for Functions, Objects, and Packages |
Version: | 0.6.0 |
Author: | Atsushi Yasumoto |
Maintainer: | Atsushi Yasumoto <atusy.rpkg@gmail.com> |
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). |
URL: | https://felp.atusy.net/, https://github.com/atusy/felp |
BugReports: | https://github.com/atusy/felp/issues |
License: | MIT + file LICENSE |
Encoding: | UTF-8 |
RoxygenNote: | 7.3.1 |
Imports: | prettycode, callr, curl, data.table, dplyr, htmltools, magrittr, matrixStats, memoise, miniUI, reactable, rstudioapi, rlang, shiny, stringi, utils |
Suggests: | knitr, printr, testthat (≥ 2.1.0), |
VignetteBuilder: | knitr |
Language: | en-US |
NeedsCompilation: | no |
Packaged: | 2024-09-25 00:48:26 UTC; atusy |
Repository: | CRAN |
Date/Publication: | 2024-09-25 12:00:05 UTC |
Functional help with ?
operator
Description
Displays 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)
Usage
`?`(e1, e2)
Arguments
e1 |
A topic of document.
Refer to |
e2 |
|
Examples
# 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
Description
A dummy data for felp
Usage
dummy
Format
An object of class list
of length 2.
Functional help which displays structure of an object in addition to help
Description
Structure of object is returned by str()
.
For a function, its source is returned instead of str()
.
Usage
felp(topic, package = NULL, ...)
Arguments
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
|
Examples
# Identical to help(identity); print(identity)
felp(identity)
# Identical to help(iris); str(iris)
felp(iris)
# Identical to help(package = stats)
felp(package = stats)
Fuzzily Search Help and View the Selection
Description
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.
Usage
fuzzyhelp(
query = "",
method = getOption("fuzzyhelp.method", "fzf"),
background = getOption("fuzzyhelp.background", TRUE),
viewer = shiny::paneViewer()
)
Arguments
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
|
Value
If the background
argument is TRUE
, then the return value inherits from
callr::r_bg()
. Otherwise, NULL
is returned.
Note
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.
Examples
if (FALSE) {
fuzzyhelp()
}