是否可以自定义xaringan以具有代码输出预订样式,即代码和输出位于同一块中?例如,请参见:
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()
默认样式在两个不同的块中具有代码和输出:
答案 0 :(得分:2)
使用the knitr chunk option <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<button class="getleads">Show Lead</button>
<table class="leadstable" border="2" align="center">
<thead>
<th>Name</th>
<th>Phone</th>
<th>Email Address</th>
<th>Nationality</th>
<th>Qualification</th>
<th>Course</th>
</thead>
<tbody id="tdata">
</tbody>
</table>
。例如:
collapse = TRUE