 Welcome back to Lesson 3 of the Introduction to R Workshop series. Let's go ahead and get started with an introduction to data frames. Data frames are the default data structure used to represent tabular data in R. These are roughly analogous to the data tables that you would find in Microsoft Excel or Google Sheets. These are stored as basically tables of vectors, all of the same length. And because they're vectors, all of the data contained in a single vector is going to be the same data type. So this is one key difference between an Excel spreadsheet and tabular data in R. Data frames can be created manually within R or more commonly created using the read CSV or read table functions. And in the context of this exercise, we're going to use the read underscore CSV function. This is the specific form of that function that's imported with the tidyverse package. The base R function is read dot CSV. And these only differ slightly. The main difference for our purposes is that the read underscore CSV function stores the data as a table. You can read more about tables by clicking the link in this in the PDF. Our purposes is just a needer presentation of the data and has some other desirable properties. Okay, we'll get started by creating a new section which we'll call creating data frames. And if you're creating a new session within R, you might want to go ahead and use the library function again just to make sure that tidyverse is loaded. That's going to be necessary for running the next function. So we're going to use the read CSV function here from the tidyverse package. But when we do that, we're going to store it inside a new variable called interviews. So again, this is the read underscore CSV function from the tidyverse package. And the first argument in this function is going to be the location of that data set. So the location of that file is in the data folder. Remember here in our main working directory, the name of the file, SAPI Clean CSV Extension. And the second argument that we're going to specify here is going to tell R what to do with the missing or null values in the data set. And we're going to say that those missing values should be stored as null. Okay, when you execute that, you see that a new kind of category of objects is created up here in our global environment indicating this is a different kind of data type. Previously, we were creating values. In this case, we've created an entire data frame that contains 131 observations or rows and 14 variables. Okay, these would be stored in the columns. And now the first thing that we're going to do here is inspect the data frame that we just created. The easiest way to do that is just to go over to the global environment and click on the new object. Okay, when you click interviews, that data frame is going to open up in a new tab next to your script file. And this allows you to view it just like you would in Excel or Google Sheets. So you can just scroll here to see all the different field names, as well as all the different rows. A way to do this with code. Go ahead and create a new section here is to use the view function. This is view with a capital V. And if you type in the name of your data frame in these parentheses and run that it'll do the exact same thing it'll open up the interviews data frame up in that separate tab. Okay, alternatively, if you're just interested in kind of zooming into particular properties or maybe rows or columns within your data. There are a selection of alternative functions that allow you to do that. The first one will introduce his head. What this is going to do is basically just return. Sorry, I've spelled interviews wrong there. This will return essentially the first just couple rows we have six rows returned as well as the header row. Okay. So often this is a, you know, a sufficient way to kind of get a feel for what's contained in your data you don't have to look at everything just kind of gives you that structure. Okay, another function that we can use here is dim, which stands for dimensions. And again, if we type that interviews, this is going to give us just the number of rows and columns in our data set. Okay, again, kind of similar information to what's contained up here in the global environment. Or if we're just interested in returning the number of rows or columns, the in row in call. Okay, so a lot of different tools here just for kind of getting some real quick summaries of our data frame without having to really examine the entire data set. And there are other functions as well that we're not going to cover here, but we do encourage you to look at page 25 in the accompanying PDF, just to see what other kinds of options you have here for getting a quick overview of your data.