Welcome to Intro Data Science

Example presentation

August 29, 2022

Welcome!

Bullet point list

Unordered

  • Item A
  • Item B
  • Item C

Ordered

  1. Item 1
  2. Item 2
  3. Item 3

Incremental list

  • Item 1
  • Item 2
  • Item 3

Equations

Write mathematical symbols and equations using Latex.

Use the formulas below to calculate \(\hat{\beta}_1\), the estimated slope, and \(\hat{\beta}_0\), the estimated intercept.

\[ \begin{aligned} &\hat{\beta}_1 = r \frac{s_y}{s_x} \\ &\hat{\beta}_0 = \bar{y} - \hat{\beta}_1 \bar{x} \end{aligned} \]

Code

# Use code chunk option fig-align: center to center the plot. 
ggplot(data = penguins, aes(x = flipper_length_mm, y = body_mass_g, 
                            color = species)) + 
         geom_point() + 
  labs(x = "Flipper Length (in mm)",y = "Body Mass (in g)",
       title = "Flipper length vs. body mass",
       subtitle = "Penguins at Palmer Station, Antartica") +
  scale_color_viridis_d()

Images

Three penguins labeled Chinstrap, Gentoo, and Adelie.

Artwork by @allison_horst

Columns

Calculate the proportion of penguins from each species.

penguins |>
  count(species) |>
  mutate(prop  = n / sum(n))
# A tibble: 3 × 3
  species       n  prop
  <fct>     <int> <dbl>
1 Adelie      152 0.442
2 Chinstrap    68 0.198
3 Gentoo      124 0.360

Panels

penguins |>
  filter(species == "Adelie", !is.na(sex)) |>
  ggplot(aes(x = flipper_length_mm, y = body_mass_g, color = sex)) + 
  geom_point() +
  labs(x = "Flipper Length (in mm)",y = "Body Mass (in g)",
       title = "Flipper length vs. body mass",
       subtitle = "Adelie Penguins at Palmer Station, Antartica") +
  scale_color_viridis_d() + 
  facet_wrap(~island)

penguins |>
  filter(species == "Adelie", !is.na(sex)) |>
  ggplot(aes(x = flipper_length_mm, y = body_mass_g, color = sex)) + 
  geom_point() +
  labs(x = "Flipper Length (in mm)",y = "Body Mass (in g)",
       title = "Flipper length vs. body mass",
       subtitle = "Adelie Penguins at Palmer Station, Antartica") +
  scale_color_viridis_d() + 
  facet_wrap(~island)

Themes

Customize the appearance of the slides using

  • Built-in Reveal theme

  • Modify built-in theme using Sass

    • Variant of CSS that supports variables and other features
  • Create custom thing using Sass

Specify the theme and/or Sass file (.scss) in the YAML