Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/text_manipulation_in_scripts.r
Open a file with a .r or .R extension and runs a gsub. No copy made except if newPath is specified, use at your own risks.
1 2 3 4 5 6 7 8 | gsubInOneScript(
fullPath,
pattern,
replacement,
newPath = NULL,
userCheck = TRUE,
ignore.case = FALSE
)
|
fullPath |
A character vector with the path to the script to modify. |
pattern |
passed to |
replacement |
passed to |
newPath |
Character vector. Used if a copy of the script should be created following this path. |
userCheck |
Logical, default = TRUE. Matches are shown to check the pattern 'accuracy' before replacement. |
ignore.case |
logical. FALSE for case-sensitive matches. Default is TRUE. |
If not working inside an R project, path has to be complete from root.
The number of matches in the file.
Alban Sagouis
To search for text in any text file, see search_files
.
1 2 | ## Not run: gsubInOneScript('DESCRIPTION','foobar@gmail.com','foobar@protonmail.com')
## Not run: gsubInOneScript('master.r','ifelse','data.table::fifelse')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.