Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Introduction to R +

Introduction to R +

Workshop Introduction to R at Telkom University, Bandung

Muhammad Aswan Syahputra

February 22, 2019
Tweet

More Decks by Muhammad Aswan Syahputra

Other Decks in Programming

Transcript

  1. Founded by Ross Ihaka & Robert Gentleman High level language

    Interactive & Programming A swiss army knife for statistical tests and models, out-of-the box!
  2. Main features: • Console • Syntax-highlighting editor • Tools for

    plotting, history, debugging and workspace management
  3. - use Projects, not setwd(...) - use script, try to

    avoid console - Ctrl+Shift+F10 and Ctrl+Alt+B, not rm(list=ls()) - Tab is your friend! - learn the handy shortcuts - do not save and load .Rdata - set up the .Rprofile - use git! Download: git-scm.com/ Reading: happygitwithr.com
  4. any_function(arg1, arg2, arg3, ...) - arguments are the contexts of

    a function - arguments are matched by name, or - arguments are matched by position, be careful! change_the_world(...) calculate_value(...) assign. <- , =, ->
  5. 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”)
  6. 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”)
  7. b > makan( celup( jilat( putar(apa = “oreo”), berapa_kali =

    2 ), ke = “susu” ), output = “kenyang.perut” )
  8. c > putar(apa = “oreo”) %>% jilat(berapa_kali = 2) %>%

    celup(ke = “susu”) %>% makan(output = “kenyang.perut”)
  9. Let’s hand on! ...and have a lot of stress fun!

    go to github.com/aswansyahputra/my_talk go to github.com/aswansyahputra/my_talk
  10. R for Data Science (r4ds.had.co.nz) Introduction to Statistical Learning (www-bcf.usc.edu/~gareth/ISL/)

    Online books (bookdown.org) Need help? install.packages(“swirl”)