Learn R Programming

Capsule (version 0.2.0)

capture_environment: Capture Environment State

Description

Captures the current global environment state including objects and their types

Usage

capture_environment(
  output_file = NULL,
  include_values = FALSE,
  max_size = 1024 * 1024
)

Value

A list containing environment information

Arguments

output_file

Character. Path to save environment info. If NULL, returns as list.

include_values

Logical. Whether to include object values (for small objects). Default FALSE.

max_size

Numeric. Maximum object size (in bytes) to include values. Default 1MB.

Examples

Run this code
if (FALSE) {
x <- 1:10
y <- "test"
capture_environment("env_state.json")
}

Run the code above in your browser using DataLab