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
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.3k
YesSQL, Process and Tooling at Scale
rocio
169
14k
We Have a Design System, Now What?
morganepeng
50
7.2k
4 Signs Your Business is Dying
shpigford
180
21k
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
Testing 201, or: Great Expectations
jmmastey
38
7.1k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Docker and Python
trallard
40
3.1k
Writing Fast Ruby
sferik
627
61k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
24k
Facilitating Awesome Meetings
lara
50
6.1k
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