Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Data Carpentry with Tidyverse
Search
Muhammad Aswan Syahputra
May 11, 2019
0
190
Data Carpentry with Tidyverse
Meetup Algoritma X Machine Learning ID X Komunitas R Indonesia
Muhammad Aswan Syahputra
May 11, 2019
Tweet
Share
More Decks by Muhammad Aswan Syahputra
See All by Muhammad Aswan Syahputra
#DS101: understanding the basics
aswansyahputra
0
67
Extending RStudio with Git(Hub)
aswansyahputra
0
82
Data rectangling in R: a journey from JSON to CSV
aswansyahputra
0
350
Basic Git+GitHub
aswansyahputra
1
310
Let's build your first RStudio and Addins
aswansyahputra
0
140
Introduction to R +
aswansyahputra
1
310
R (+) for Data Science
aswansyahputra
0
100
R + RStudio Tips and Tricks
aswansyahputra
0
160
Blogging with R
aswansyahputra
0
99
Featured
See All Featured
Site-Speed That Sticks
csswizardry
2
190
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2k
Optimizing for Happiness
mojombo
376
70k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5k
The Language of Interfaces
destraynor
154
24k
Reflections from 52 weeks, 52 projects
jeffersonlam
347
20k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Raft: Consensus for Rubyists
vanstee
137
6.7k
YesSQL, Process and Tooling at Scale
rocio
169
14k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
Transcript
None
• Sensory Scientist @ Sensolution.ID • Trainer @ R-Academy Telkom
University and The Datanomics Institute (TDI) • Initiator of Komunitas R Indonesia • Pkgs: sensehubr, nusandata, bandungjuara, prakiraan, etc • Shinyapps: sensehub, thermostats, aquastats, bcrp, bandungjuara, etc aswansyahputra @aswansyahputra_
R Indonesia R Indonesia www.r-indonesia.id Komunitas t.me/GNURIndonesia @r_indonesia_ indo-r www.r-indonesia.id
R Indonesia www.r-indonesia.id
Know your neighbour! • Who are you? • What you
do with data? • How would you describe your experience with R?
Artwork by @allison_horst
Artwork by @allison_horst
Data Carpentry?
It’s so relatable, is it not?
None
None
“ Do not underestimate DATA PREPROCESSING
is not a single process but a thousand of little
skills and techniques “ - David Minmo
Artwork by @allison_horst The tidyverse is an opinionated collection of
R packages designed for data science. All packages share an underlying design philosophy, grammar, and data structures.
Program Import Tidy Transform Visualise Model Communicate Understand
Program Import Tidy Transform Visualise Model Communicate Understand
Artwork by @allison_horst tidyr
Artwork by @allison_horst dplyr
dplyr basic functions: • filter() selects rows based on their
values • mutate() creates new variables • select() picks columns by name • summarise() calculates summary statistics • arrange() sorts the rows dplyr basic functions: • filter() selects rows based on their values • mutate() creates new variables • select() picks columns by name • summarise() calculates summary statistics • arrange() sorts the rows Credits to Michael Toth tidyr basic functions: • gather() wide-format >> long-format • spread() long-format >> wide-format • fill() fills value based on previous entry • complete() turns implicit missing values into explicit tidyr basic functions: • gather() wide-format >> long-format • spread() long-format >> wide-format • fill() fills value based on previous entry • complete() turns implicit missing values into explicit Operators: • ! (not) • I (or) • & (and) • ==, != • <, <=, >, >= • %in% • is.na() Operators: • ! (not) • I (or) • & (and) • ==, != • <, <=, >, >= • %in% • is.na()
How can I chain?
None
1. diputar 2. dijilat 3. dicelupin 4. dimakan :D
1. putar(apa) 2. jilat(apa, berapa_kali) 3. celup(apa, ke) 4. makan(apa,
output)
a > oreo_putar ← putar(apa = “oreo”) > oreo_jilat ←
jilat(apa = oreo_putar, berapa_kali = 2) > oreo_celup ← celup(apa = oreo_jilat, ke = “susu”) > makan(apa = oreo_celup, output = “kenyang.perut”)
> oreo_putar ← putar(apa = “oreo”) > oreo_jilat ← jilat(apa
= oreo_putar, berapa_kali = 2) > oreo_celup ← celup(apa = oreo_jilat, ke = “susu”) > makan(apa = oreo_celup, output = “kenyang.perut”) a
> makan( celup( jilat( putar(apa = “oreo”), berapa_kali = 2
), ke = “susu” ), output = “kenyang.perut” ) b
function(arg1, arg2, arg3,...) arg1 %>% function(arg2, arg3,...) function(arg1, arg2, arg3,...)
arg2 %>% function(arg1, arg2=.,arg3,...) magrittr
> putar(apa = “oreo”) %>% jilat(berapa_kali = 2) %>% celup(ke
= “susu”) %>% makan(output = “kenyang.perut”) c
What to do today?
None
www.onepiece.fandom.com www.onepiece.fandom.com
Let’s get started! • Let’s write R scripts together! •
I will demonstrate and explain the use of each code • Access this presesentation at: s.id/data-carpentry- with-tidyverse
None
None
None
None
None
None
s.id/yt_aswansyahputra s.id/yt_aswansyahputra
Thanks!
[email protected]
www.aswansyahputra.com speakerdeck.com/ aswansyahputra R Indonesia www.r-indonesia.id