class: title-slide, left, bottom # Importing Data ---- ## **Session 3** ### ### .right-column[ ] --- class: center, middle # Import data to R </br> There are R packages to import all types of data. </br> In this course, we'll cover the most </br> common imports: </br> </br> csvs and Excel workbooks -- </br> We'd like to import the `capacity_ae.csv` file. </br> </br> While we could write code from scratch to do this, </br> it's often easier to get the import wizard to do this </br> for you. --- class: center, middle # Import data to R We will use the "Import Dataset" button (but you can also click on the file itself): </br> <img class="center" src="data:image/png;base64,#img/session03/import-screenshot.PNG" width="80%"/> --- # Import data to R We will use the "Import Dataset" button: </br> <img class="center" src="data:image/png;base64,#img/session03/drop-down-import.PNG" width="60%"/> --- # Import data to R The package used to install csvs is {readr} which is loaded with the {tidyverse} package. Excel workbooks require the package {readxl}. </br> <img class="center" src="data:image/png;base64,#img/session03/drop-down-import-csv.PNG" width="60%"/> --- # Import wizard Locate the file capacity_ae.csv </br> <img src="data:image/png;base64,#img/session03/wizard.PNG"/> --- # Import wizard </br> <img src="data:image/png;base64,#img/session03/capacity-ae-preview.PNG"/> --- # Import wizard </br> <img src="data:image/png;base64,#img/session03/import-button.PNG"/> --- # Import wizard </br> <img src="data:image/png;base64,#img/session03/copy-wizard-code.PNG"/> --- # Import wizard </br> <img src="data:image/png;base64,#img/session03/copy-code-preview.PNG"/> --- # Import wizard Once copied then select .green[Cancel] and then .green[Paste]. .left-col[.left[ From the clipboard: <img class="center" src="data:image/png;base64,#img/session03/paste-code.PNG"/> ]] -- .right-col-.right[ Where just one line copied: <img src="data:image/png;base64,#img/session03/paste-selected-code.PNG"/> ] --- # Run code from the editor </br> <img class="center" src="data:image/png;base64,#img/session03/run-code.PNG"/> No need to highlight all code to run. </br> Put the cursor in the line you want to run then select the button to Run or <kbd> Ctrl + Return </kbd> --- #### This work is licensed as </br> Creative Commons </br> Attribution </br> ShareAlike 4.0 </br> International </br> To view a copy of this license, visit </br> https://creativecommons.org/licenses/by/4.0/