class: center, middle, inverse, title-slide # Lab 01 ## Intro to R ### 01.17.19 --- class: center, middle # Welcome to lab --- ## Agenda 1. **Lab strucuture:** Lab structure overview. 2. **Lab 01 intro and demos:** Introduce the lab, and work through the first section as a class. 3. **On your own:** Work on the rest of the lab "on your own", but feel free to check in with teammates as much as you like. --- class: center, middle # Lab strucuture --- ## Lab strucuture - ~ 10 minute introduction (a bit longer today) - Use the remaining time to work through the lab exercises and fill out your lab report + Today: on your own + Remainder of the semester: in teams - Lab instructions posted on the course website under <i class="fa fa-file-code-o fa-lg"></i> + Go to the course website to find today's lab instructions. --- ## Tips - You do not have to finish the lab in class, they will always be due the following Wednesday at 11:59p. One work strategy is to get through portions that you think will be most challenging (which initially might be the coding component) during lab when I can help you on the spot and leave the narrative writing till later. - Do not pressure each other to finish early; use the time wisely to really learn the material and produce a quality report. - When working in teams, do **not** split up the lab among the team members; work on it together in its entirety. --- class: center, middle # Lab 01 intro and demos --- ## Goals <small> - **Introduce you to R and RStudio:** + R is the name of the programming language itself + RStudio is a convenient interface - **Introduce you to Git and GitHub:** collaboration and version control system that we will be using throughout the course + Git is a version control system -- like "Track Changes" features from Microsoft Word on steroids + GitHub is the home for your Git-based projects on the internet - **Take small steps:** + This a solo lab to make versioning (working with Git) simpler + Next week you’ll learn about collaborating on GitHub and produce a single lab report for the team </small> --- ## Getting started <small> You may watch or follow along: - Find the GitHub repo with the prefix `lab-01-intro-r`. - On GitHub, click on the green **Clone or download button**, select **Use HTTPS** if it is not already selected. Click on the clipboard icon to copy the repo URL. - Go to RStudio Cloud and into the course workspace. Create a **New Project from Git Repo**. You will need to click on the down arrow next to the **New Project** button to see this option. - Copy and paste the URL of your assignment repo into the pop up dialog box. - Click OK. Now it's your turn! When you're done with this part, you may continue if you like or wait until I demonstrate the next part. Please raise your hand if you have any questions. </small> --- ## Configure git <small> Next, we need to configure git so RStudio and GitHub can communicate with each other. You may watch or follow along: - Type the following lines of code in the **console**: ```r library(usethis) use_git_config(user.name="your name", user.email="your email") ``` - If you get an error message, it may be because you need to install the `usethis` package. You can type the code below in the console to install the package ```r install.packages("usethis") ``` Once you're configured git, you're ready to complete the rest of lab! </small> --- class: middle, center ## You're now ready to complete the rest of lab! --- ## More practice with R (optional) - RStudio Cloud Primer: Work with Data - [https://rstudio.cloud/learn/primers/2](https://rstudio.cloud/learn/primers/2) - DVS Intro to R Workshop - Jan 22 at 2p - [https://duke.libcal.com/event/4799048](https://duke.libcal.com/event/4799048) - R for Data Science: Data Visualization - [https://r4ds.had.co.nz/data-visualisation.html](https://r4ds.had.co.nz/data-visualisation.html)