library(flipbookr)
library(here)
library(tidyverse)
library(kjhslides)
kjh_register_tenso()
kjh_set_knitr_opts()
kjh_set_slide_theme()
kjh_set_xaringan_opts()

class: center middle main-title section-title-1

A Title Slide with .kjh-yellow[R]

.class-info[

Data Wrangling: Session 1

.light[Kieran Healy
Statistical Horizons, April 2022 ]

]


layout: true class: title title-1


A Bullet Point Slide

 

--

.box-inv-1.medium[Blah]

--

.box-inv-1.medium[Blah]

--

.box-inv-1.medium.sp-after[Blah]


layout: false class: center

.huge.middle.squish4[
.kjh-orange[DATA ANALYSIS]
is mostly
.kjh-red[DATA WRANGLING]]


layout: true class: title title-1


More Wisdom for the Ages

Header 2

Header 3

Header 4


.kjh-green[Colors] and .kjh-pink[monospace()]

.pull-left[

.kjh-green[Green]

.kjh-blue[Blue]

.kjh-lblue[Light Blue]

]

.pull-right[

.kjh-pink[Pink]

.kjh-orange[Orange]

.kjh-yellow[Yellow]

]


layout: true class: title title-1


library(palmerpenguins)

r chunk_reveal("penguin_tabs", widths = c(35,65), title = "# Breaks")

penguins %>% 
  filter(year != 2007) %>% 
  group_by(species) %>% 
  summarize(across(starts_with("bill"), 
                   list(mean = mean, 
                        sd = sd),
                   .names = "{.fn}_{.col}",
                   na.rm = TRUE)) 

as_tibble(cars) %>%
  filter(speed > 4) %>%
  ggplot() +
  aes(x = speed) +
  aes(y = dist) + #BREAK
  geom_point(
    alpha = .8, 
    color = "blue" 
    ) + #BREAK
  aes(size = speed) #BREAK

r chunk_reveal("my_cars", break_type = "auto", title = "# Chunk Breaks")


Code-left / Fig Right method

.pull-left.w35[

Make sure the chunk has the string "codefig" in its label to protect against breaking refs.

library(tidyverse)
library(gapminder)

p <- ggplot(data = gapminder, 
            mapping = aes(x = gdpPercap, 
                          y = lifeExp)) + 
  geom_point()

p

]

--

.pull-right.w60[

knitr::include_graphics(
  knitr::fig_chunk("codefig-first-plot", "png")
)

]


layout: false

Figure

.center[

The tidyverse
]


layout: true class: title title-1


Input and Output

.pull-left[

What we have
]

.pull-right[

What we want
]


Pull left and right

.pull-left.center[

The tidyverse
]

--

.pull-right[.box-inv-1.medium[Introduction]]

--

.pull-right[.box-inv-1.medium[Deep-dive]]

--

.pull-right[.box-inv-1.medium[Some more]]


Pull left and right

.pull-left[

Option 1

--

.pull-right[

Option 2


Scale Images small

:scale 10%


Scale images medium

.right[:scale 40%]



kjhealy/kjhslides documentation built on Dec. 30, 2024, 10:30 p.m.