Perform the following steps:
- First we plot the two boxplots of factor gears regarding mpg, with the plot separated from the transmission type:
> par(mfrow=c(1,2)) > boxplot (mtcars$mpg~mtcars$gear,subset=(mtcars$am==0),xlab='gear' , ylab = "mpg",main='automatic') > boxplot (mtcars$mpg~mtcars$gear,subset=(mtcars$am==1),xlab='gear', ylab = "mpg", main='manual')
- Also, you may produce a boxplot of mpg by the number of forward gears * transmission type, with the use of the * operation in the boxplot function:
> boxplot(mtcars$mpg~factor(mtcars$gear)* factor(mtcars$am),xlab='gear ...