Mr scientist 14 January, 2022
- Load data
- Don’t be afraid to add headers along the report
- There’s also plots and tables all around
- Another cool option is doing code folding
- Rendering Latex
source("../passwords.R") # never post your passwords to Github again!
plot(mtcars$mpg, mtcars$cyl)
pandoc.table(head(mtcars[, 1:4]))
mpg | cyl | disp | hp | |
---|---|---|---|---|
Mazda RX4 | 21 | 6 | 160 | 110 |
Mazda RX4 Wag | 21 | 6 | 160 | 110 |
Datsun 710 | 22.8 | 4 | 108 | 93 |
Hornet 4 Drive | 21.4 | 6 | 258 | 110 |
Hornet Sportabout | 18.7 | 8 | 360 | 175 |
Valiant | 18.1 | 6 | 225 | 105 |
You can also include tables using the powerful gt
package:
as_raw_html(gt(head(mtcars[, 1:4])))
mpg | cyl | disp | hp |
---|---|---|---|
21.0 | 6 | 160 | 110 |
21.0 | 6 | 160 | 110 |
22.8 | 4 | 108 | 93 |
21.4 | 6 | 258 | 110 |
18.7 | 8 | 360 | 175 |
18.1 | 6 | 225 | 105 |
SOME CODE
print("source: https://gist.github.com/joyrexus/16041f2426450e73f5df9391f7f7ae5f")
## [1] "source: https://gist.github.com/joyrexus/16041f2426450e73f5df9391f7f7ae5f"
You can render Latex on a github document by specifying in the YAML header:
output:
github_document:
pandoc_args: --webtex
Here’s an example: