 It's LinkedIn Learning author Monica Wahee with today's data science makeover. Watch while Monica Wahee demonstrates how to use the class command to figure out object and data types with a data frame in R. Today we are going to start talking about object types and data types in R. You'll see that I'm biased. I'm a big fan of data frames. In fact, I already used the readRDS command to read in the demonstration data set called line items. I'll put a link in the description to the video where I do that. And I already ran a call names command on the data set so you can see the column names in the console. I have a video on this too that I'll link to in the description. So let's ask our first question which is what kind of object in R is the data set we read in called line items? Maybe you didn't know to ask that question. R has a lot of different types of objects with different properties. There are matrices, there are tables, there's vectors, and then there are my favorite things in the whole world which are data frames. But no matter what line items is, I can figure out what it is by using the class command. See that? All it says is class and then there is one argument in the parenthesis and that is our data set line items. Actually, let's run this. See here on the console, it says that it's a data frame. It says data.frame. We are happy to see that because that's what we want. I like data frames. But like I said, matrices and tables often masquerade as data frames because they are tabular. If you ever think you are editing a data frame in R and it is not cooperating, before you go too far, run a class command on it and just make sure it's a data frame. Okay, here's something else the class command is good for and that is figuring out the type of data in a data field in a data frame. Remember the variable tot underscore cost in our data set? Actually, let's run the data frame and look at it. See the tot underscore cost column? It looks like currency or something, some number. Let's say we wanted to know what the exact data type was of the tot underscore cost column. We could run a class statement on it. See here, this is the same as a class statement above except see this dollar sign and then the word tot underscore cost. We are now running the class statement specifically on this column as opposed to on the whole data set. All right, let's run this puppy now. Oh, look at that. It's numeric. I'll try to make some more videos explaining what you can do with the different data types and object types. One of the best ways to make over your data fields is to convert them. Don't you think? This was your data science makeover for today. Bye for now. Click on the link in the description.