Advanced Data Wrangling Presentation Using Tidyverse

Your Name

Welcome

Advanced Data Wrangling Techniques with Tidyverse
This presentation demonstrates key wrangling functions and reproducible outputs using the mtcars dataset.

Agenda

  • Overview of mtcars
  • Joining data with left_join()
  • Reshaping data with pivot_longer()
  • Splitting columns with separate()
  • Reproducible chart example
  • Reproducible table example
  • Reflection

About the mtcars Dataset

Note

mtcars is a built-in dataset in R, containing fuel consumption and automobile design specs for 32 cars.

[1] 32
   mpg cyl disp  hp drat    wt  qsec vs am gear carb             model    brand
1 21.0   6  160 110 3.90 2.620 16.46  0  1    4    4         Mazda RX4    Mazda
2 21.0   6  160 110 3.90 2.875 17.02  0  1    4    4     Mazda RX4 Wag   Datsun
3 22.8   4  108  93 3.85 2.320 18.61  1  1    4    1        Datsun 710   Hornet
4 21.4   6  258 110 3.08 3.215 19.44  1  0    3    1    Hornet 4 Drive  Valiant
5 18.7   8  360 175 3.15 3.440 17.02  0  0    3    2 Hornet Sportabout     Merc
6 18.1   6  225 105 2.76 3.460 20.22  1  0    3    1           Valiant Cadillac
# A tibble: 6 × 4
  model         brand  measurement  value
  <chr>         <chr>  <chr>        <dbl>
1 Mazda RX4     Mazda  mpg          21   
2 Mazda RX4     Mazda  hp          110   
3 Mazda RX4     Mazda  wt            2.62
4 Mazda RX4 Wag Datsun mpg          21   
5 Mazda RX4 Wag Datsun hp          110   
6 Mazda RX4 Wag Datsun wt            2.88
# A tibble: 3 × 2
  Brand   Model
  <chr>   <chr>
1 MazdaRX 4    
2 MazdaRX 4Wag 
3 Datsun  710  
Average MPG by Car Brand
brand avg_mpg
Valiant 25.5
Datsun 25.0
Hornet 24.2
Mazda 19.4
Merc 18.3
Fiat 17.4
Cadillac 17.1
Toyota 13.7

Thank You! 🎉