Replace all occurences of a pattern in a file
str_replace_all_in_file(
file,
pattern,
replacement = "[...]",
only_comments = TRUE,
collapse = FALSE
)
NULL, the file is modified in place
character, path of file to be modified
character, pattern to be replaced
character, replacement text
logical, should the replacement only be done in comments
logical, should the lines be collapsed into a single line before replacement