Learn R Programming

statnet.common (version 4.10.0)

empty_env: Replace an object's environment with a simple, static environment.

Description

Replace an object's environment with a simple, static environment.

Usage

empty_env(object)

base_env(object)

Value

An object of the same type as object, with updated environment.

Arguments

object

An object with the environment()<- method.

Examples

Run this code
f <- y~x
environment(f) # GlobalEnv

environment(empty_env(f)) # EmptyEnv

# \dontshow{
stopifnot(identical(environment(empty_env(f)), emptyenv()))
# }

environment(base_env(f)) # base package environment

# \dontshow{
stopifnot(identical(environment(base_env(f)), baseenv()))
# }

Run the code above in your browser using DataLab