append_objectnames: Append text to object names in the global environment

View source: R/append_objectnames.R

append_objectnamesR Documentation

Append text to object names in the global environment

Description

For a specified set of objects in the global environment, append text to the end of the object names. 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

append_objectnames(
  objects, append_text, sep = "", ask = TRUE, envir = .GlobalEnv)

Arguments

objects

character vector, the names of the objects for which to append text. Can be a call to ls_grep, which allows pattern matching.

append_text

character string, the text to append to each object's name.

sep

character string, text to place as separator between object names and appended text. Defaults to "".

ask

logical, whether to prompt the user before replacing 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.