find_replace: Find and replace text in object names in the global...

Description Usage Arguments

View source: R/find_replace.R

Description

Search all object names in the global environment for a regex pattern, and replace that pattern with specified text. This is actually done by creating copies of the objects with new names and deleting the original versions, which may consume large amounts of memory if the objects are large. By default, the user is prompted before objects are renamed.

Usage

1
2
find_replace(pattern, replace,
 pattern_find=NULL, ask=TRUE)

Arguments

pattern

character string, the regex pattern to replace. Passed to grep via ls_grep.

replace

character string, the text with which to replace pattern.

pattern_find

optional character string used to determine objects. Can be different from pattern, which allows renaming a subset of objects in the global environment. Defaults to NULL, which results in objects being matched with pattern.

ask

logical, whether to prompt the user before replacing objects. Defaults to TRUE.


mjdufort/miscHelpers documentation built on Sept. 24, 2018, 7:09 p.m.