Nothing
% Writing beautiful and reproducible slides quickly % Yihui Xie % 2012/04/30
\documentclass{beamer}
and \title{}
, I have finished my first slide with markdown-
" instead of \begin{itemize}
and \item
; how things can be simpler?head(cars)
## speed dist
## 1 4 2
## 2 4 10
## 3 7 4
## 4 7 22
## 5 8 16
## 6 9 10
cor(cars)
## speed dist
## speed 1.0000 0.8069
## dist 0.8069 1.0000
library(ggplot2)
qplot(speed, dist, data = cars) + geom_smooth()
pandoc -s -S -i -t dzslides --mathjax knitr-slides.md -o knitr-slides.html
knitr-slides.md
is the markdown output from its source: library(knitr); knit('knitr-slides.Rmd')
Knit HTML
in RStudiopre
blocks should have max-width
and max-height
)It is good to include the session info, e.g. this document is produced with knitr. Here is my session info:
print(sessionInfo(), locale = FALSE)
## R version 4.4.0 (2024-04-24)
## Platform: x86_64-pc-linux-gnu
## Running under: Ubuntu 22.04.4 LTS
##
## Matrix products: default
## BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so; LAPACK version 3.10.0
##
## attached base packages:
## [1] stats graphics grDevices utils datasets methods base
##
## other attached packages:
## [1] ggplot2_3.5.1 knitr_1.46.4
##
## loaded via a namespace (and not attached):
## [1] vctrs_0.6.5 nlme_3.1-164 cli_3.6.2 rlang_1.1.3
## [5] xfun_0.44 highr_0.10.2 labeling_0.4.3 glue_1.7.0
## [9] colorspace_2.1-0 formatR_1.14 scales_1.3.0 fansi_1.0.6
## [13] grid_4.4.0 munsell_0.5.1 evaluate_0.23 tibble_3.2.1
## [17] lifecycle_1.0.4 compiler_4.4.0 codetools_0.2-20 pkgconfig_2.0.3
## [21] mgcv_1.9-1 farver_2.1.2 lattice_0.22-6 digest_0.6.35
## [25] R6_2.5.1 utf8_1.2.4 pillar_1.9.0 splines_4.4.0
## [29] magrittr_2.0.3 Matrix_1.7-0 tools_4.4.0 withr_3.0.0
## [33] gtable_0.3.5
out.width
which will be used in <img width=... />
, e.g. out.width=400px
so keep your audience awake!
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.