make_copies: Duplicate objects in the global environment based on names...

View source: R/make_copies.R

make_copiesR Documentation

Duplicate objects in the global environment based on names matching a grep pattern.

Description

Duplicate multiple ojects in an environment based on a grep pattern match. This allows modification of one version of the objects without losing the previous versions. Useful for testing modifications to objects generated by time-consuming code. This is a simple wrapper for makeCopy.

Usage

make_copies(var_pattern, append=".old", ask=TRUE, envir=.GlobalEnv)

Arguments

var_pattern

character string, the regex pattern to match object names. Passed to grep via ls_grep.

append

character string, the text to be appended to the objects' names when making the copies. Defaults to ".old".

ask

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

envir

the name of the environment in which to make the changes. Defaults to the global environment, .GlobalEnv.


mjdufort/miscHelpers documentation built on Feb. 4, 2024, 7:44 p.m.