9.1 3-D Scatterplot
Since the
ggplot2
package and its extensions can’t create a 3-D plot, you can create a 3-D scatterplot with thescatterplot3d
function in thescatterplot3d
package.Let’s plot automobile mileage vs. engine displacement vs. car weight using the data in the
mtcars
dataframe –mtcars
comes with base R and contains information on 32 cars measured on 11 variables.