Learn R Programming

aisdk (version 1.1.0)

get_r_context: Get R Context

Description

Generates a text summary of R objects to be used as context for the LLM.

Usage

get_r_context(vars, envir = parent.frame())

Value

A single string containing the summaries of the requested variables.

Arguments

vars

Character vector of variable names to include.

envir

The environment to look for variables in. Default is parent.frame().

Examples

Run this code
# \donttest{
if (interactive()) {
df <- data.frame(x = 1:10, y = rnorm(10))
context <- get_r_context("df")
cat(context)
}
# }

Run the code above in your browser using DataLab