Kernel density plots with ggplot2 in R

Kernel density function is a nonparametric method to find the drawing density curve of random samples, and it is often used to draw a smoothed curve in data visualization. In R programming with ggplot2 package, a chaining of functions ggplot() and geom_density() is often used to draw different smoothed curves showing the distribution of continuous variables.