Response to R code generation and execution with session continuity
response_to_r(
chat_obj,
prompt,
add_text = NULL,
pkgs_to_use = c(),
objects_to_use = list(),
existing_session = NULL,
list_packages = TRUE,
list_objects = TRUE,
return_session_info = TRUE,
evaluate_code = TRUE,
r_session_options = list(),
return_mode = c("full", "code", "console", "object", "formatted_output", "llm_answer",
"session"),
max_iterations = 3
)Result based on return_mode
Chat object from ellmer
User prompt for R code generation
Additional instruction text
Packages to load in R session
Named list of objects to load in R session
Existing callr session to continue from (optional)
Whether to list available packages in prompt
Whether to list available objects in prompt
Whether to return session state information
Whether to evaluate the generated code
Options for callr R session
Return mode specification
Maximum retry attempts