Hello, and welcome. In this video, we will show you how to read CSV files, Excel files, and built-in datasets using the R programming language. A common file format for structured data is CSV, which stands for comma separated values. CSV files store the data in a table format, and in each row, every column value is separated by a delimiter. As the name would suggest, this delimiter is traditionally a comma. In order to read a CSV data file, all we need to do is call the “read.csv” function while passing in the path to the file. We can also use R to read in XLS files, which is the file format of an Excel spreadsheet. But unlike CSV, R does not have a native function for reading Excel files. So to add this functionality, we’re going to have to run the “install.packages” function. Once a package is installed, it does not need to be installed again unless it is uninstalled. Whenever you use a library that is not native to R, you have to load it into the R environment by calling the “library” function. After you’ve done so, reading an Excel file is as simple as calling “read_excel” and passing in the path to the file. In order to make use of the data that we’re reading, we need to assign the output to a variable. By default, R will structure the data as a data frame, which provides us with a lot of tools and flexibility. You can see here that after assigning the data to a variable name, we’ve used the variable name to get a preview of the data. The snippet you’re seeing here shows the first four columns. Once we have the dataset loaded in a variable, we can start accessing its elements. So for example, say we wanted to access the “name” column, highlighted here. To do so, we can directly reference the column name inside the square brackets. In this output snippet, you can see we get the elements of this particular column. You can also retrieve an entire row from a dataset, like the one highlighted here. Inside the square brackets, simply type the row number you want to access, followed by a comma, leaving the column blank. This will retrieve the selected row with all of the columns of the dataset. It may be the case that you want to retrieve a row, but you’re only interested in a select number of columns, like the ones highlighted here. So we can access that row like before, but instead of leaving the column blank, we’ll use the “c” function to form a vector with the columns we’re interested in. As you can see in the output, this ensures that we only extract the desired columns. We’ve been working with data that we read in from a file, but R actually provides a number of built-in datasets that we can use. To see the available datasets, all we need to do is call the “data” function. The output returns all the datasets, each with a small description included. Everything in the “datasets” package is built-in. Take a look at the “CO2” dataset here. We’re going to use this dataset to quickly show another utility function that R provides. R provides documentation for each of the datasets, which we can access by calling the “help” function along with the dataset’s name. You can see that this provides a lot of information. The description will give you a better idea of the nature of the data, as well as the dataset’s size. Since this dataset is built-in, we don’t need to import it or load it in order to start accessing the data. We can immediately start referencing it by name since R has already prepared the dataset. So you can start to see what the CO2 data looks like in the output. By now, you should understand how to read and access CSV files, excel files, and built-in datasets. Thank you for watching this video.