From the course: R for Data Science: Analysis and Visualization

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Importing data from a spreadsheet

Importing data from a spreadsheet - R Tutorial

From the course: R for Data Science: Analysis and Visualization

Importing data from a spreadsheet

- [Instructor] Now, it's great to use R's built-in sample data to see how the program works and to play around with some options. But chances are, you're going to want to analyze your own data. And the easiest way to deal with that is to import it, either as a CSV or comma separated values files, like a generic one-page spreadsheet, or as an Excel XLS or XLSX file. I'm going to be showing you how to do both of these using a package that comes as part of the tidyverse readxl. Now let's start by loading the tidyverse and then we'll load readxl. Now, even though this is installed as part of the tidyverse, because it's not part of the base packages, it needs to be loaded separately or explicitly. So, I'm going to load that now. And then I'm going to come down and first load a CSV file. This is the most common way of sharing data. CSV files are single sheets of rows and columns, they tend to be very easy to be imported into any…

Contents