Now that we have imported the automobile fuel efficiency data into R and learned a little about the nuances of importing, the next step is to do some preliminary analysis of the dataset. The purpose of this analysis is to explore what the data looks like and get your feet wet with some of R's most basic commands.
If you have completed the previous recipe, you should have everything that you need to continue.
The following steps will lead you through the initial exploration of our dataset, where we compute some of its basic parameters:
- First, let's find out how many observations (rows) are in our data:
nrow(vehicles) ## 34287
- Next, let's find out how many variables (columns) are in our data:
ncol(vehicles) ## 74
- Now, let's get a sense of which columns of data are present in the data frame using the
names
function:
> names(vehicles)
The preceding command will give you the following output:
Luckily, a lot of these...