Identify if use of pipe operator can improve a code section
pipe_can_improve_this(fname, window_len = 2)A numeric vector corresponding to start of the window to be reviewed. If no lines are found, NULL is returned.
A filename - either a Rmd/qmd or R script.
A window length to analyse.
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.