knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of hp is to allow you to pipe a function into help using the {magrittr}
pipe, %>%
.
The development version from GitHub with:
# install.packages("devtools") remotes::install_github("erictleung/hp")
This is a basic example which shows you how to solve a common problem:
library(hp) library(dplyr) # Simple single function t.test %>% h # Simple single function with parentheses dim() %>% h # Function but specifying package dplyr::across %>% h # Function but specifying package with parentheses dplyr::summarise() %>% h
The h()
function is designed to only work interactively.
Additionally, this package was created because the {magrittr} pipe doesn't play
well with piping in functions into the help()
function.
This was fixed with the new native R pipe operator, |>
.
dim |> help()
Note, the left side should not have parentheses or R will warn you that the
help()
function requires, "a name, length-one character vector or reserved
word."
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.