i

R Programming Complete Tutorial

R Density Plot

A density plot is a representation of a numeric variable's distribution. It uses a kernel density estimate to show the probability density function of a variable. It is a smoothed version of the Histogram and is used on the same carpet.  In this example, first, we are calculating the Kernel Density Estimation using the density function of mpg data.

Graph Output:

Dot plots:

A dot plot, also called a dot chart, is a simple Histogram like chart used in relatively small data sets statistics, where values fell into a variety of discrete bins. We can create a Dot plot using the dotchart function. In our example, we are creating a dot plot using mpg data.

Graph Output: