IyarLin / boilerplate-script

This repo contains a boilerplate script to serve as a base for reproducible development. See also https://wp.me/p8rgs6-9M

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Novel research that will disrupt the industry

Mr scientist 14 January, 2022


Load data

source("../passwords.R") # never post your passwords to Github again!

Don’t be afraid to add headers along the report


They’ll all show up in the table of contents!


There’s also plots and tables all around

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

gt tables

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

Another cool option is doing code folding

SOME CODE

Like this!

print("source: https://gist.github.com/joyrexus/16041f2426450e73f5df9391f7f7ae5f")
## [1] "source: https://gist.github.com/joyrexus/16041f2426450e73f5df9391f7f7ae5f"

Rendering Latex

You can render Latex on a github document by specifying in the YAML header:

output:
  github_document:
    pandoc_args: --webtex

Here’s an example:

 X \sim \mathcal{N}(\mu,\sigma^2) \rightarrow f(x)= \frac{1}{\sigma \sqrt{2\pi}}e^{-\frac{1}{2}\left(\frac{x-\mu}{\sigma}\right)^2}

About

This repo contains a boilerplate script to serve as a base for reproducible development. See also https://wp.me/p8rgs6-9M