Right Arrow
or Space
Left Arrow
Home
End
Esc
S
F
Alt + Click
E
Inline code: variable
Code block:
porridge = "blueberry"
if porridge == "blueberry":
print("Eating...")
In-line math: x+y=z
Block math:
We can write fractions: 23. We can also handle things like estimated population growth rate, e.g., ˆλ=1.02. And, √4=2.
α,β,γ,Γ
a±b x≥15 ai≥0 ∀i
$$A{m,n} =
\begin{pmatrix}
a{1,1} & a{1,2} & \cdots & a{1,n}
a{2,1} & a{2,2} & \cdots & a{2,n}
\vdots & \vdots & \ddots & \vdots
a{m,1} & a{m,2} & \cdots & a{m,n}
\end{pmatrix}$$
The binomial probability: (f(y|N,p)=N!y!(N−y)!⋅py⋅(1−p)N−y=Ny⋅py⋅(1−p)N−y)
To calculate the mean of \textit{n} observations of variable \textit{x}, you can use: $$\bar{x} = \frac{1}{n} \sum{i=1}^{n}x{i}$$
Note that this equation looks quite nice above where it’s in display math mode. It is more compact but not quite as nice looking if we present it using inline mode, e.g., $\bar{x} = \frac{1}{n} \sum{i=1}^{n}x{i}$.
Let’s do the same with the equation for variance. First the inline version, which is $\sigma^{2} = \frac{\sum\limits{i=1}^{n} \left(x{i} - \bar{x}\right)^{2}} {n-1}.Andthenthedisplaymodeversion:$\sigma^{2} = \frac{\sum{i=1}^{n} \left(x{i} - \bar{x}\right)^{2}} {n-1}$$
Next, it’s good to look at the equation for covariance to see how it is just a generalization of variance to two variables. An inline version of the equation is $cov{x,y} = \frac{\sum\limits{i=1}^{n}{(x_i-\overline{x}) \cdot (yi-\overline{y})} }{n-1}.And,thedisplaymodeis:$cov{x,y} = \frac{\sum\limits_{i=1}^{n}{(x_i-\overline{x}) \cdot (y_i-\overline{y})} }{n-1}$$
And, finally, we’ll end with the standard deviation. Here’s the inline version, $\sigma = \sqrt{\frac{\sum\limits{i=1}^{n} \left(x{i} - \bar{x}\right)^{2}} {n-1}}.Andhere′sthedisplayversion.$\sigma = \sqrt{\frac{\sum\limits{i=1}^{n} \left(x{i} - \bar{x}\right)^{2}} {n-1}}$$
There are helpful online editors to help you learn code for various equations you might want to include. I have found the one at: http://visualmatheditor.equatheque.net/VisualMathEditor.html to be very useful. You can work out the code there and then copy it over to your RMarkdown document in between dollar signs (1 or 2 on either end depending on whether you want the equation in line or in display mode).
Make content appear incrementally
{{% fragment %}} One {{% /fragment %}}
{{% fragment %}} **Two** {{% /fragment %}}
{{% fragment %}} Three {{% /fragment %}}
Press Space
to play!
One Two Three
A fragment can accept two optional parameters:
class
: use a custom style (requires definition in custom CSS)weight
: sets the order in which a fragment appearsAdd speaker notes to your presentation
{{% speaker_note %}}
- Only the speaker can read these notes
- Press `S` key to view
{{% /speaker_note %}}
Press the S
key to view the speaker notes!
Customize the slide style and background
{{< slide background-image="/img/boards.jpg" >}}
{{< slide background-color="#0000FF" >}}
{{< slide class="my-style" >}}
Let’s make headers navy colored.
Create assets/css/reveal_custom.css
with:
.reveal section h1,
.reveal section h2,
.reveal section h3 {
color: navy;
}