gadenbuie / xaringanExtra

:ferris_wheel: A playground of enhancements and extensions for xaringan slides.
https://pkg.garrickadenbuie.com/xaringanExtra
Other
445 stars 36 forks source link

[panelset] output as default view #182

Closed Enchufa2 closed 2 months ago

Enchufa2 commented 1 year ago

Is it possible to set the default panel view? Or the panel ordering? It would be nice to be able to have an additional chunk option to e.g. invert code and output, so that the output is shown by default.

gadenbuie commented 2 months ago

After #193, you can now re-order the code and output panels

```{r panelset = c(output = "Plot", source = "ggplot2")}
ggplot(Orange) +
  aes(x = age, y = circumference, colour = Tree) +
  geom_point() +
  geom_line() +
  guides(colour = FALSE) +
  theme_bw()

or in Quarto syntax
#| panelset:
#|   - output: Plot
#|   - source: ggplot2
ggplot(Orange) +
  aes(x = age, y = circumference, colour = Tree) +
  geom_point() +
  geom_line() +
  guides(colour = FALSE) +
  theme_bw()