clean_llm_code: Clean LLM-generated R code
Description
Replaces literal '\n' with real line breaks, trims whitespace, and optionally indents.
Usage
clean_llm_code(code_string, indent = FALSE)
Value
Cleaned R code as a single string.
Arguments
- code_string
Character string returned by LLM (with '\n' line breaks).
- indent
Logical, whether to indent lines (for printing only).