class: title-slide, left, bottom # Importing Data ---- ## **Session 3** ### ### .right-column[ ] --- class: center, middle # Import data to R There are R packages to import all types of data. In this course, we'll cover the most common imports: csvs and Excel workbooks -- We'd like to import the `capacity_ae.csv` file. While we could write code from scratch to do this, it's often easier to get the import wizard to do this 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): <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: <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}. <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 <img src="data:image/png;base64,#img/session03/wizard.PNG"/> --- # Import wizard <img src="data:image/png;base64,#img/session03/capacity-ae-preview.PNG"/> --- # Import wizard <img src="data:image/png;base64,#img/session03/import-button.PNG"/> --- # Import wizard <img src="data:image/png;base64,#img/session03/copy-wizard-code.PNG"/> --- # Import wizard <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 <img class="center" src="data:image/png;base64,#img/session03/run-code.PNG"/> No need to highlight all code to run. 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 Creative Commons Attribution ShareAlike 4.0 International To view a copy of this license, visit https://creativecommons.org/licenses/by/4.0/