This is a simplified version of a script I wrote for work. We have a large code base, built up over many years. The end result was a mismatch in formatting.
This script is an example of bulk editing R scripts using regular expressions. In particular, standardising the naming convention of R functions to the piped format eg thisIsPiped <- function(){...}.
Please have these packages:
# packages library(magrittr) library(data.table) library(rprojroot) # I'm using an rstudio project in my root folder For this tutorial, I have saved in to a “/scripts” folder two files: