How it works...
The data frame is an incredibly powerful datatype used by R, and we will leverage it heavily throughout this recipe. The data frame allows us to group variables of different datatypes (numeric, strings, logical, factors, and so on) into rows of related information. One example will be a data frame of customer information. Each row in the data frame can contain the name of the person (a string), along with an age (numeric), a gender (a factor), and a flag to indicate whether they are a current customer (Boolean). If you are familiar with relational databases, this is much like a table in a database.
Furthermore, in this recipe, we looked at several ways of getting a quick read on a dataset imported into R. Most notably, we used the powerful table function to create a count of the occurrence of values for the fuelType1 variable. This function is capable of much more, including cross tabulations, as follows:
with(vehicles, table(sCharger, year))
The preceding command will give you the following output:

Here, we looked at the number of automobile models by year, with and without a super charger (and we saw that super chargers have seemingly become more popular more recently than they were in the past).
Also, note that we use the with command. This command tells R to use vehicles as the default data when performing the subsequent command, in this case, table. Thus, we can omit prefacing the sCharger and year column names with the name of the data frame and vehicles, followed by the dollar sign.