Created
May 24, 2019 22:01
-
-
Save malcolmbarrett/97315963a2ee56e4df21286b265a4399 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| title: "Presentation Ninja" | |
| subtitle: "⚔<br/>with xaringan" | |
| author: "Yihui Xie" | |
| date: "2016/12/12 (updated: `r Sys.Date()`)" | |
| output: | |
| xaringan::moon_reader: | |
| css: ["default", "hiddencloud"] | |
| lib_dir: libs | |
| nature: | |
| highlightStyle: github | |
| highlightLines: true | |
| countIncrementalSlides: false | |
| --- | |
| class: hiddencloud | |
| # Some Tips | |
| An example of using the trailing comment `#<<` to highlight lines: | |
| ````markdown | |
| `r ''````{r tidy=FALSE} | |
| library(ggplot2) | |
| ggplot(mtcars) + | |
| aes(mpg, disp) + | |
| geom_point() + #<< | |
| geom_smooth() #<< | |
| ``` | |
| ```` | |
| Output: | |
| ```{r tidy=FALSE, eval=FALSE, } | |
| library(ggplot2) | |
| ggplot(mtcars) + | |
| aes(mpg, disp) + | |
| geom_point() + #<< | |
| geom_smooth() #<< | |
| ``` | |
| --- | |
| class: hiddencloud | |
| # Some Tips | |
| When you enable line-highlighting, you can also use the chunk option `highlight.output` to highlight specific lines of the text output from a code chunk. For example, `highlight.output = TRUE` means highlighting all lines, and `highlight.output = c(1, 3)` means highlighting the first and third line. | |
| ````md | |
| `r ''````{r, highlight.output=c(1, 3)} | |
| head(iris) | |
| ``` | |
| ```` | |
| ```{r, highlight.output=c(1, 3), echo=FALSE} | |
| head(iris) | |
| ``` | |
| Question: what does `highlight.output = c(TRUE, FALSE)` mean? (Hint: think about R's recycling of vectors) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment