When I pass input to $chat that has (single) newlines, they're stripped away when the chat is printed out:
library(ellmer)
ch <- chat_claude()
res <- ch$chat("
```r
library(ggplot2)
ggplot(mtcars) + aes(x = mpg) + geom_histogram()
```
")
#> This R code... [redacted]
ch
#> <Chat turns=2 tokens=49/302>
#> ── user ────────────────────────────────────────────────────────────────────────
#> ```r library(ggplot2) ggplot(mtcars) + aes(x = mpg) + geom_histogram() ```
#> ── assistant ───────────────────────────────────────────────────────────────────
#> This R code... [redacted]
Created on 2025-01-09 with reprex v2.1.1
This makes it particularly hard to read code and code output when looking back at a chat's turns.
When I pass input to
$chatthat has (single) newlines, they're stripped away when the chat is printed out:Created on 2025-01-09 with reprex v2.1.1
This makes it particularly hard to read code and code output when looking back at a chat's turns.