class: center, middle, inverse, title-slide # Lab 05: Data wrangling & regression ### 02.15.19 --- ## Agenda 1. Lab introduction 2. Getting started 3. Password caching --- ## Lab introduction - <font class="vocab">Data:</font> [Airbnb.com](https://www.airbnb.com/) listings in Asheville, NC - The data is from [insideairbnb.com](http://insideairbnb.com/) - <font class="vocab">Goals: </font> - **Data wrangling**: cleaning and transforming data so it is in a format that can be used for statistical analysis - **Regression**: Fit an interpret a model to predict the total cost to stay at an Airbnb for 3 nights. - <font class="vocab">Tips: </font> - Use the links in the lab instructions to see documentation for some of the functions needed for today's lab. - Use [Chapter 5 in *R for Data Science*](https://r4ds.had.co.nz/transform.html) as a resource for the data wrangling functions --- ## Starting a new project - Go to the course GitHub organization and find the **lab-05** repo that has your team name on it. - On GitHub, click on the green Clone or download button, select Use HTTPS (this might already be selected by default, and if it is, you’ll see the text Clone with HTTPS). 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 dialog box and click OK. - **Update the name of your RStudio project to "Lab 05 - Airbnb"** --- ## Configure Git - Type the following lines of code in the console in RStudio filling in your name and email address. ```r library(usethis) use_git_config(user.name="your name", user.email="your email") ``` --- ## Caching your password You need to cache your password on a per-project basis: - Go to the **Terminal** within a project (the most recent lab?) - Type the following to cache your password for `\(60 * 60 * 24 * 7 = 604800\)` seconds ```bash git config --global credential.helper 'cache --timeout 604800' ``` You will need to enter your GitHub username and password one more time after caching the password. After that you won't need to enter your credentials for 604800 seconds = 7 days.