Learn R Programming

usethat (version 0.3.0)

use_pipes: Use different pipes in your package

Description

The function adds the useful operators to use in your project. These operators include:

  • %>% Forward Pipe operator

  • %||% NULL operator

Usage

use_pipes(path = "R", export = TRUE)

Arguments

path

(character) A path pointing at where to copy the file.

export

If TRUE, the file content is exported to NAMESPACE.

Value

No return value, called for side effects.

Details

The function:

  1. Copies a file with several pipes 'path/utils-pipes.R' and

  2. Imports the purrrpackage in the project DESCRIPTION file

Examples

Run this code
# NOT RUN {
path <- tempfile()
use_pipes(path)
print(readLines(file.path(path, "utils-pipes.R")))

# }

Run the code above in your browser using DataLab