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
Facilitating Awesome Meetings
lara
50
6.1k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
The Cost Of JavaScript in 2023
addyosmani
45
6.8k
Agile that works and the tools we love
rasmusluckow
327
21k
Side Projects
sachag
452
42k
How STYLIGHT went responsive
nonsquared
95
5.2k
A Philosophy of Restraint
colly
203
16k
The Pragmatic Product Professional
lauravandoore
31
6.3k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
Building an army of robots
kneath
302
43k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
Art, The Web, and Tiny UX
lynnandtonic
297
20k
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