inline_plugin: Create Plugin

Description Usage Arguments Examples

View source: R/inline_plugin.R

Description

Create an inline plugin.

Usage

1

Arguments

dev, prod

Development and production functions to run when in either state. These callback function should accept a single argument lines, a vector of character strings: the source code where each character string is a line of code. They also should accept an ellipsis ... for future extensibility.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
chg_magrittr_to_native <- function(lines) {
  gsub("\\%>\\%", "|>", lines)
}

code <- 'function(x) {
  x %>%
    sum()
}'

chg_magrittr_to_native(code)

pre-processing-r/rpp documentation built on Dec. 23, 2021, 11:16 p.m.