Factory function to create an RCodeRunner instance for safe R code execution.
Arguments
- timeout
Numeric. Maximum execution time in seconds. Default 30.
- max_output_chars
Integer. Maximum characters for stdout/stderr. Output exceeding this limit is truncated. Default 100000 (100KB).
- allowed_packages
Character vector. Packages that may be loaded. This is defense-in-depth only; not a security boundary.
Default: c("base", "stats", "utils", "methods").
- prelude
Character vector. R code to run before user code. Useful for setting options or loading common utilities.
