This is a guide for adding content to this course.
To edit a lecture, edit the index.Rmd file.
To edit a lab, edit the Rmd files (lab and lab key).
To render most files use the make command in the main directory.
To render labs and lectures to just have code to create a .R file use:
Rscript -e "knitr::purl('name_of_rmd.Rmd')"
We will work on the old makefiles and perhaps use GitHub actions to make this more automated.
If you want to add emojis to your lectures use this package.
This is currently installed like:
# install.packages("devtools")
devtools::install_github("hadley/emo")
To use an emoji inline with your text use:
`r emo::ji("smile")`
To use an emoji in a chunk use:
emo::ji("smile")
If you want to change the style of a slide, modify the style.css file.
For example - this is how you can make slides with smaller font:
In the style .css file is the following- which creates smaller font:
.small {
font-size: 0.8em;
}
This can be applied to a slide by putting {.small} next to a slide title like so:
## slide name {.small}
In the style .css file is the following- which creates smaller font:
.codesmall pre {
font-size: 16px;
}
This can be applied to a slide by putting {.codesmall} next to a slide title like so:
## slide name {.codesmall}
:::{style="color: red;""}
RED STUFF!
:::
In the styles.css file is the following:
.codeexample pre{
background-color: lightgreen;
}
To add this to a chunk use this in the Rmd file before and after the chunk:
<div class = "codeexample">
```{r}
#some code
```
</div>
Additional help
To create video gifs first record your screen like so (note this is for Mac users):
- Command + Shift + 5
- Select either entire screen - or more likely a portion of the screen button
- Click record
Next convert the video to a gif using https://ezgif.com/video-to-gif.
Be sure that you select gif as the output.