positron
positron copied to clipboard
Add code cells support for `knitr::spin()` syntax
We already have support for code cells in R with syntax like this (similar to the Python support):
# %%
1 + 1
# %%
library(tidyverse)
diamonds |>
filter(carat > 2) |>
group_by(color) |>
summarise(price = median(price))
Let's consider adding additional, alternative syntax support in .R files for using the knitr::spin() support, as outlined:
- https://quarto.org/docs/computations/render-scripts.html#knitr
- https://bookdown.org/yihui/rmarkdown-cookbook/spin.html
It would be really cool if cell options could be better integrated into positron
#| fig-width: 6
#| fig-height: 4
library(tidyverse)
diamonds |>
filter(carat > 2) |>
group_by(color) |>
summarise(price = median(price
would display a 6 x 4 image in the plots panel
@kylebutts I believe we are tracking that in #3676, if you'd like to give a 👍 or add additional detail.
@kylebutts shared some very useful context about this format in https://github.com/posit-dev/positron/pull/3858.