Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

use_pipe

Use magrittr's pipe in your package


Description

Does setup necessary to use magrittr's pipe operator, %>% in your package. This function requires the use roxygen.

  • Adds magrittr to "Imports" in DESCRIPTION.

  • Imports the pipe operator specifically, which is necessary for internal use.

  • Exports the pipe operator, if export = TRUE, which is necessary to make %>% available to the users of your package.

Usage

use_pipe(export = TRUE)

Arguments

export

If TRUE, the file R/utils-pipe.R is added, which provides the roxygen template to import and re-export %>%. If FALSE, the necessary roxygen directive is added, if possible, or otherwise instructions are given.

Examples

## Not run: 
use_pipe()

## End(Not run)

usethis

Automate Package and Project Setup

v2.0.1
MIT + file LICENSE
Authors
Hadley Wickham [aut] (<https://orcid.org/0000-0003-4757-117X>), Jennifer Bryan [aut, cre] (<https://orcid.org/0000-0002-6983-2759>), RStudio [cph, fnd]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.