i

R Programming Complete Tutorial

ggplot2 Pie Chart

A pie chart is a representation of values as slices of a circle with different colors. In this example, we have created a dataframe, income using month-wise income data. We are going to use this data frame as a data source. In aes, we are setting Earning in Y-axis and fill with month data.

Now setting the geom_bar and coord_polar function, we can create a beautiful pie chart.

Example of Pie Chart:

Graph Output: