Skip to content

Latest commit

 

History

History
19 lines (19 loc) · 353 Bytes

File metadata and controls

19 lines (19 loc) · 353 Bytes

Density Plot

Base R Graphic

Actual Code
plot(density(mtcars$mpg),
     main = "Density Plot of Miles/(US) gallon")

ggplot2 Graphic

Preparation Code
# Functions
library(ggplot2)
Actual Code
ggplot(mtcars, aes(mpg))+
      geom_density() +
      labs(title = "Density Plot of Miles/(US) gallon")