---
title: "Introduction<br>RStudio"
author: "Keith VanderLinden<br>Calvin University"
output:
  xaringan::moon_reader:
    nature:
      titleSlideClass: ["left", "top"]
      highlightLines: true
      ratio: "16:9"      
---

# Analysing Data using R and RStudio

.pull-left[
We will use the following tools to work with data.

- *R* --- A programming language configured for statistical analysis.
- *Posit/RStudio* --- An [Integrated Development Environment (IDE)](https://en.wikipedia.org/wiki/Integrated_development_environment) that supports exploratory data analysis using R.

Both R & Posit/RStudio are open-source and are commonly used by data scientists.

You are free to use [https://r.cs.calvin.edu/](https://r.cs.calvin.edu/) or to install [Posit/RStudio](https://posit.co/) on your own machine. 

.footnote[See: https://en.wikipedia.org/wiki/Integrated_development_environment]

]
.pull-right[
![r logo](images/r-logo.png)

<!-- ![posit logo](images/posit.png) -->
![rstudio logo](images/rstudio-logo.png)
]
---

# RStudio Demo

.pull-left[
RStudio integrates a variety of data management and programming tools, including:

- R programming console
- Environment objects browser
- File browser
- File editor

We demo this tool using [https://r.cs.calvin.edu/](https://r.cs.calvin.edu/).
]
.pull-right[
![RStudio](images/rstudio-overview.png)
]

???
Prepare students for the lab by demoing RStudio.calvin.edu.

- R programming console
  - `1 + 1`
- Environment
  - `x <- c("one", "two")` then see the value for x.
- File browser
  - Show suggested directory structure for INFO 601.
- File editor
  - Open the lab 1.2 Rmd file and show how they'll edit it for the lab assignment.

- Walk through the GapMinder example code from the slides (see `01introduction/class/rosling.Rmd`). Showing:
  - The packages pane (e.g., `gapminder` documentation)
  - The help pane (e.g., `?summarize`)
  - Knitting the document.
  - Running the code chunks.
  
- Preview the Rmd file management required for lab 1.2.

- Why not just use Excel? Spreadsheets are useful but their:
    - code is hard to debug.
    - statistical resources are limited.
    - analyses are not:
        - Reproducible (recreate the same analysis).
        - Reusable (apply the same analysis to different data).

References: 
- <https://ids-s1-20.github.io/slides/week-01/w1-d05-toolkit-r/w1-d05-toolkit-r.html#14>
- <https://cs.calvin.edu/courses/data/202/21fa/slides/w01/w1d2-toolkit.html#9>

We'll focus on R & RMarkdown in the next unit.
