capture_environment: Capture Environment State

View source: R/capture_session.R

capture_environmentR Documentation

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
)

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.

Value

A list containing environment information

Examples

## Not run: 
x <- 1:10
y <- "test"
capture_environment("env_state.json")

## End(Not run)

Capsule documentation built on Nov. 11, 2025, 5:14 p.m.