1

Is it possible to customize xaringan to have the code output bookdown style, that is, code and output in the same block?. For instance, see this:

library(tidyverse)
#> ── Attaching packages ────────────────────────────────── tidyverse 1.2.1 ──
#> ✔ ggplot2 3.1.0.9000     ✔ purrr   0.2.5     
#> ✔ tibble  2.0.0          ✔ dplyr   0.7.8     
#> ✔ tidyr   0.8.2          ✔ stringr 1.3.1     
#> ✔ readr   1.3.1          ✔ forcats 0.3.0
#> ── Conflicts ───────────────────────────────────── tidyverse_conflicts() ──
#> ✖ dplyr::filter() masks stats::filter()
#> ✖ dplyr::lag()    masks stats::lag()

The default style has the code and the output in two different blocks:

4

1 回答 1

3

使用knitr chunk选项 collapse = TRUE例如:

```{r, collapse=TRUE}
library(tidyverse)
```
于 2019-06-30T03:03:10.587 回答