class: center, middle, inverse, title-slide # The whole game
👾 --- layout: true <div class="my-footer"> <span> <a href="http://bit.ly/bootcamp-nuigalway" target="_blank">bit.ly/bootcamp-nuigalway</a> </span> </div> --- class: middle # Welcome! --- ## About me .pull-left[ <img src="img/mine_circle.png" width="80%" style="display: block; margin: auto;" /> ] .pull-right[ __Mine Çetinkaya-Rundel__ - Senior Lecturer, University of Edinburgh - Data Scientist & Professional Educator, RStudio - Associate Professor of the Practice, Duke University .midi[ 🔗 [mine-cr.com](http://mine-cr.com) ✍️ [citizen-statistician.org](http://citizen-statistician.org) 🐦 [@minebocek](https://twitter.com/minebocek) 🔘 she/her ] ] --- class: center, middle ## About you? --- ## Logistics - Everything in one place: [bit.ly/bootcamp-nuigalway](http://bit.ly/bootcamp-nuigalway) - RStudio Cloud: [rstd.io/dsbox-cloud](https://rstd.io/dsbox-cloud) - Asking for help: Type in chat (but if I don't see it, feel free to interrupt!) --- class: middle # Software --- <img src="img/excel.png" width="80%" style="display: block; margin: auto;" /> --- <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-07.jpeg" width="100%" style="display: block; margin: auto;" /> --- <img src="img/data-science-cycle-08.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;" /> --- <img src="img/rmarkdown.png" width="90%" style="display: block; margin: auto;" /> --- class: middle # Let's dive in! --- <img src="img/unvotes-01.jpeg" width="100%" style="display: block; margin: auto;" /> --- <img src="img/unvotes-02.jpeg" width="100%" style="display: block; margin: auto;" /> --- <img src="img/unvotes-03.jpeg" width="100%" style="display: block; margin: auto;" /> --- <img src="img/unvotes-04.jpeg" width="100%" style="display: block; margin: auto;" /> --- <img src="img/unvotes-05.jpeg" width="100%" style="display: block; margin: auto;" /> --- <img src="img/unvotes-06.jpeg" width="100%" style="display: block; margin: auto;" /> --- <img src="img/unvotes-07.jpeg" width="100%" style="display: block; margin: auto;" /> --- <img src="img/unvotes-08.jpeg" width="100%" style="display: block; margin: auto;" /> --- <img src="img/unvotes-09.jpeg" width="100%" style="display: block; margin: auto;" /> --- <img src="img/unvotes-10.jpeg" width="100%" style="display: block; margin: auto;" /> --- <img src="img/unvotes-11.jpeg" width="100%" style="display: block; margin: auto;" /> --- <img src="img/unvotes-12.jpeg" width="100%" style="display: block; margin: auto;" /> --- <img src="img/unvotes-13.jpeg" width="100%" style="display: block; margin: auto;" /> --- <img src="img/unvotes-14.jpeg" width="100%" style="display: block; margin: auto;" /> --- .center[ .large[ [minecr.shinyapps.io/unvotes](https://minecr.shinyapps.io/unvotes/) ] ] <img src="img/unvotes-15.jpeg" width="75%" style="display: block; margin: auto;" /> --- .your-turn[ - Go to [rstd.io/dsbox-cloud](https://rstd.io/dsbox-cloud) and join the workspace. - On RStudio Cloud, start the assignment called `AE 01a - UN Votes` or `AE 01a - COVID`. - In the Files pane in the bottom right corner, spot the file called `unvotes.Rmd` (or `covid.Rmd`). Open it, and then click on the "Knit" button. - Go back to the file and change your name on top (in the `yaml` -- we'll talk about what this means later) and knit again. - Change the country names to those you're interested in. Your spelling and capitalization should match how the countries appear in the data, so take a peek at the Appendix to confirm spelling. Knit again. Voila, your first data visualization! ]
10
:
00
--- class: middle # Data in the wild --- <img src="img/gender-pronouns.jpeg" width="100%" style="display: block; margin: auto;" /> --- <img src="img/trump-tweets.jpeg" width="100%" style="display: block; margin: auto;" /> --- <img src="img/covid.jpeg" width="100%" style="display: block; margin: auto;" /> --- <img src="img/code-examples.jpeg" width="100%" style="display: block; margin: auto;" /> --- class: middle .huge-blue[R] --- ## 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. -- - As of August 2020, there are over 16,000 packages available on the **C**omprehensive **R** **A**rchive **N**etwork (CRAN), the public clearing house for R packages. Source: [r-pkg.org](https://www.r-pkg.org/). -- - This huge variety of packages is one reason why R is so successful: the chances are that someone has already solved a problem that you’re working on, and you can benefit from their work by downloading their 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")` --- class: middle .huge-blue[RStudio] --- ## RStudio <img src="img/rstudio-anatomy.png" width="80%" style="display: block; margin: auto;" /> --- class: middle .huge-blue[R Markdown] --- ## R Markdown <img src="img/rmarkdown-anatomy.png" width="100%" style="display: block; margin: auto;" /> --- ## How will we use R Markdown? - Every "your turn" exercise is an R Markdown document - You'll always have a template R Markdown document to start with - The amount of scaffolding in the template will decrease over the bootcamp --- 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;" /> ] --- class: middle .huge-blue[Getting help in R] --- ## Reading help files .pull-left[ You can get help on any function by typing the function name in the Console with a `?` before it: ```r ?mean ``` ] .pull-right[ <img src="img/r-help.png" width="100%" style="display: block; margin: auto;" /> ] .xsmall[ Source: http://socviz.co/appendix.html#a-little-more-about-r ] --- ## Package help - **Many** modern packages have user friendly web pages with function descriptions, code examples, and vignettes (problem-oriented long form articles that walk you through features of the package), e.g. [ggplot2.tidyverse.org](https://ggplot2.tidyverse.org/). -- - **All** packages on CRAN have a dedicated with high-level package documentation such as a description, dependencies, etc. as well as a link to a PDF reference manual, e.g. [cran.r-project.org/web/packages/ggplot2](https://cran.r-project.org/web/packages/ggplot2/index.html). -- - **Some** packages also have cheatsheets which can be quite handy! [rstudio.com/resources/cheatsheets](https://rstudio.com/resources/cheatsheets/) .alert[ I recommend using the package websites when available since they display output of code in the examples whereas the help in R and reference manual does not. ] --- .your-turn[ Take a few minutes in breakout sessions to come up with a list of 1-2 questions you would like clarified before we move on to the next module. ]
05
:
00