keep {MDMA}R Documentation

Save something to an object

Description

keep saves an object to a new object. This is useful if one wants to save an intermediate result when using pipes.

Usage

keep(object, name, pos = 1, envir = as.environment(pos), inherits = FALSE)

Arguments

object

the object that is to be saved into name.

name

the name of the new object, containing the value of object.

pos

where to do the assignment. See ?assign for more details.

envir

the environment to use. See ?assign for more details.

inherits

should the enclosing framss of the environment be inspected? See ?assign for more details.

Value

Upon saving object to name, the value of object is returned. This makes it suitable for pipes.

Author(s)

Mathijs Deen

Examples

mtcars |>
  lm(mpg ~  disp + hp, data = _) |>
  keep(lm.mpg_disp_hp) |>
  summary()

[Package MDMA version 1.1.0 Index]