Questions about the course?
Questions from the prepare assignment?
Tour of R and RStudio
Let’s take a tour of R and RStudio. Go to vm-manage.oit.duke.edu and open the STA210 Docker containers.
3 * 5 + 10
x <- 3
x + x^2
x <- 1:10
x*7
- Environment
- Loading and viewing a data frame
- Accessing a variable in a data frame
- R functions
AE-02: Bikeshare Analysis
- Run the following code in the console to download the data and Rmd file for today’s application exercise. (Note: You will learn how to clone a GitHub repo in tomorrow’s lab.) Your RStudio may refresh, and you will see the R Markdown files and data set.
usethis::use_course("sta210-fa21/ae-02")
Understanding the R Project & R Markdown
- R Project
- R Markdown file
R Markdown vs. Console
- Run the following in the console
x <- 2
x * 3
- Then add the following in an R code chunk in your R Markdown file.
x * 3
- What happens? Why the error?
- Let’s fix it!
Bikeshare analysis
GitHub demo
- Configure git using SSH – covered in lab tomorrow!
- Clone repo + start new project
- Update document
- 🧶 ✅ ⬆️ knit, commit, push
- Check changes in GitHub repo
- See Commit history
Submission
There is nothing to submit for today’s AE. Starting Monday, you will submit push your AE to your GitHub repo.