h: Pipe-able wrapper function around help()

Description Usage Arguments Details Value Source Examples

View source: R/h.R

Description

This function allows you to pipe forward functions to open its help page.

Usage

1
h(x)

Arguments

x

expression

Details

Using the pipe operator is commonplace and can influence the way you think about using functions. When looking up help pages, it is typical to add a question mark ? to the beginning of a function open its help page (e.g., ?dim). This function allows you to write left-to-right and simply pipe the function of interest into h to open its help page.

Value

None

Source

https://stackoverflow.com/a/52080518/6873133

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# Simple single function
eval %>% h

# Simple single function with parentheses
dim() %>% h

# Function but specifying package
dplyr::across %>% h

# Function but specifying package with parentheses
dplyr::summarise() %>% h

# Fails
iris %>% dplyr::mutate %>% h
iris %>% dplyr::mutate() %>% h

erictleung/hp documentation built on Dec. 20, 2021, 5:29 a.m.