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
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Designing for humans not robots
tammielis
250
25k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
29
2k
What's in a price? How to price your products and services
michaelherold
243
12k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
66k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
A Modern Web Designer's Workflow
chriscoyier
693
190k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Why Our Code Smells
bkeepers
PRO
335
57k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.2k
Reflections from 52 weeks, 52 projects
jeffersonlam
347
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