Learn R Programming

autoharp (version 0.2.0)

pipe_can_improve_this: Identify if use of pipe operator can improve a code section

Description

Identify if use of pipe operator can improve a code section

Usage

pipe_can_improve_this(fname, window_len = 2)

Value

A numeric vector corresponding to start of the window to be reviewed. If no lines are found, NULL is returned.

Arguments

fname

A filename - either a Rmd/qmd or R script.

window_len

A window length to analyse.

Details

A rolling window approach is used here. For each expression, the assigned object is extracted (if any). Subsequent lines are checked to see if this object appears as an actual argument.

Window length two means that only one more line is checked.