A tool that executes R code and returns the result. By default, runs in a separate process for safety (requires the callr package).
Format
A tool definition created with ellmer::tool().
Details
This tool intentionally uses R's code evaluation capabilities to execute arbitrary R code provided by the LLM. This is a core feature for agentic workflows where the agent needs to perform data analysis or other R tasks.
For safety:
By default, code runs in a sandboxed subprocess via callr
A timeout prevents runaway execution
The Permissions system can disable this tool entirely