assign_in_global: Assign a Value to a Name

View source: R/utilities.R

assign_in_globalR Documentation

Assign a Value to a Name

Description

Assign a Value to a Name

Usage

assign_in_global(value, x, print = FALSE, envir = .GlobalEnv, ...)

Arguments

value

a value to be assigned to x.

x

a variable name, given as a character string. No coercion is done, and the first element of a character vector of length greater than one will be used, with a warning.

print

logical whether to also print

envir

the environment to use. See ‘Details’.

...

additional arguments passed to assign

Value

value object (invisibly)

See Also

assign

Examples

## print and assign copy of mtcars
mtcars %>%
  print() %>%
  assign_in_global("mtcars2")

## same as above but using print argument
mtcars %>% assign_in_global("mtcars2", TRUE)

the-mad-statter/washu documentation built on May 5, 2024, 10:26 a.m.