Recreate these plots to the best of your ability
In this section, we will be using the mtcars data set. Let’s start by reading in ggplot and the mtcars data set.
For more information about this data set, look in the help section.
?mtcars()
Now, let’s take a look a little closer at the data set. Which ‘class’ do these variables belong to? Are they numeric? Characters? Integers?
This knowledge is very impoartant when building your plots.
Hints
Here is an example of how to change the variable type inside of the ggplot lines and outside. Notice here, we are calling the am column with the $ operator.
You may also need to search for ggplot format help on these. Please see the extra resources at the bottom of this page.
Plot time
Graph 1: geom_point
Graph 2: geom_boxplot
[1] "0" "1"