What does stat means in ggplot?



I am currently studying about visualisation in R using ggplot2 packages while studying it I came across a code in which plotting is done with the help of ggplot.

intl = read.csv("intl.csv")
ggplot(intl, aes(x=Region, y=PercentOfIntl)) +
  geom_bar(stat="identity") +

I want to know what does stat means in the code.


hello @harry,

1.Plotting the store_counts which is a column in a dataset:

ggplot(data = store_type_agg, aes(x = store_type,y = store_type_count,fill = store_type))+
                                            geom_bar(stat = "identity")

This gives a plot in which the y variable is a column in the dataset.

2.We use stat = “bin” when the variable is not a column in the dataset:

ggplot(data = store_sales,aes(store_type,fill = store_type))+geom_bar(stat = “bin”)

Default is count data when you set stat = “bin”

Hope this helps!!