| Title: | Replace Variable Names in R Scripts |
|---|---|
| Description: | Choose a target, a replacement, files or folders, and whether you want to replace standard variables, function calls, argument names, formal names, or package names. |
| Authors: | Antoine Fabri [aut, cre] |
| Maintainer: | Antoine Fabri <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.0.0.9000 |
| Built: | 2026-05-28 09:05:13 UTC |
| Source: | https://github.com/moodymudskipper/replace |
Use to replace code in a collection of files, keeping control on the type of replacement.
replace_in_files( target, replacement, paths = "R", what = c("var", "fun"), regex = FALSE, ... )replace_in_files( target, replacement, paths = "R", what = c("var", "fun"), regex = FALSE, ... )
target |
a string |
replacement |
a string |
paths |
a vector of paths or folders, if the latter all R scripts (".R", ".r") are considered |
what |
one or several of "var", "fun", "arg", "formal", "package", "comment", "expression". They are
mapped to token types found in the output of |
regex |
a boolean. Whether to use regular expressions for detection and replacement.
For comments the "#" should be included in |