find_replace: Find and Replace Text in an Rstudio Project Directory

Description Usage Arguments See Also

Description

This function takes the current project directory (by default), and peforms a project-wide, global find & replace in all files (via gsub()); this is similar to how one might use sed, but in R syntax. This function is designed to be only run interactively, and is strict in its request for confirmation, to prevent any accidental replacement.

Usage

1
find_replace(pattern, replacement, proj_dir = here::here(), ...)

Arguments

pattern

Pattern to search for. Pattern is taken as a regular expression (since it is passed to gsub()), so care needs to be taken when passing this argument, both in terms of what you want to change vs. what you don't want to change (e.g. find_replace("ya.da", "yadda", "yabda") will return "yadda").

replacement

Replacement for pattern.

proj_dir

Project directory to search. By default, calls here::here() to guess.

...

Other arguments passed on to gsub.

See Also

gsub


ryapric/base.plus documentation built on May 10, 2019, 8:29 a.m.