class: center, middle, inverse, title-slide # R-NA
😂 --- layout: true <div class="my-footer"> <span> </span> </div> --- class: middle # Welcome! --- ## These slides are made with R .pull-left[ <img src="img/marda.jpeg" width="80%" style="display: block; margin: auto;" /> ] .pull-right[ __Mardakhlan__ - Backbone of these slides was made by Mine Çetinkaya-Rundel - She is an amazing data Scientist & Professional Educator, RStudio .midi[ 🐦 [@minebocek](https://twitter.com/minebocek) ] ] --- ## Logistics - Everything in one place: [https://bit.ly/3i3zzX0](https://bit.ly/3i3zzX0) - RStudio Cloud: [https://rstudio.cloud/spaces/86874/project/1593858](https://rstudio.cloud/spaces/86874/project/1593858) - Asking for help: Type in chat and feel free to interrupt --- ## What we will cover today? - R set up & hands on example of data wrangling problem --- class: middle # Software --- <img src="img/r.png" width="50%" style="display: block; margin: auto;" /> --- <img src="img/rstudio.png" width="80%" style="display: block; margin: auto;" /> --- class: middle # Data science life cycle --- <img src="img/data-science-cycle-01.jpeg" width="100%" style="display: block; margin: auto;" /> --- <img src="img/data-science-cycle-02.jpeg" width="100%" style="display: block; margin: auto;" /> --- <img src="img/data-science-cycle-03.jpeg" width="100%" style="display: block; margin: auto;" /> --- <img src="img/data-science-cycle-04.jpeg" width="100%" style="display: block; margin: auto;" /> --- <img src="img/data-science-cycle-05.jpeg" width="100%" style="display: block; margin: auto;" /> --- <img src="img/data-science-cycle-06.jpeg" width="100%" style="display: block; margin: auto;" /> <img src="img/data-science-cycle-09.jpeg" width="100%" style="display: block; margin: auto;" /> --- <img src="img/data-science-cycle-10.jpeg" width="100%" style="display: block; margin: auto;" /> --- ## RStudio <img src="img/rstudio-anatomy.png" width="80%" style="display: block; margin: auto;" /> --- class: middle # Let's dive in! --- --- .your-turn[ Take a few minutes to log in and launch Rstudio on your computer. ]
10
:
00
--- ## R Markdown <img src="img/rmarkdown-anatomy.png" width="100%" style="display: block; margin: auto;" /> --- ## How will we use R Markdown? - You'll always have a template R Markdown document to start with --- class: middle .huge-blue[tidyverse] <img src="img/tidyverse.png" width="15%" style="display: block; margin: auto 0 auto auto;" /> --- ## tidyverse .pull-left[ The tidyverse is an opinionated collection of R packages designed for data science. All packages share an underlying design philosophy, grammar, and data structures. ] .pull-right[ <img src="img/tidyverse-packages.png" width="100%" style="display: block; margin: auto;" /> ] --- ## R - R can be used as a calculator. ```r 8738787213 / 1653 ``` ``` ## [1] 5286623 ``` - The most commonly used data type in R is data frames, where each row represents an observation, and each column a variable. ``` ## name start end party ## 1 Eisenhower 1953-01-20 1961-01-20 Republican ## 2 Kennedy 1961-01-20 1963-11-22 Democratic ## 3 Johnson 1963-11-22 1969-01-20 Democratic ## 4 Nixon 1969-01-20 1974-08-09 Republican ## 5 Ford 1974-08-09 1977-01-20 Republican ## 6 Carter 1977-01-20 1981-01-20 Democratic ``` --- ## R - We use the `$` operator to access a variable within a data frame. ```r presidential$name ``` ``` ## [1] "Eisenhower" "Kennedy" "Johnson" "Nixon" "Ford" "Carter" "Reagan" ## [8] "Bush" "Clinton" "Bush" "Obama" ``` - Functions are (often) verbs, followed by what they will be applied to in parentheses. ```r do_this(to_this) do_that(to_this, to_that, with_those) ``` --- ## R - In R, the fundamental unit of shareable code is the package. -- - Using R packages: - Install them from CRAN with `install.packages("x")` - Use them in R with `library(x)` - Get help on them with package `?x` and `help(package = "x")` --- <img src="img/pipe.jpeg" width="80%" style="display: block; margin: auto;" /> --- .your-turn[ Let's explore an real life example ]
20
:
00