ggplot2 is considered one of the primary R packages used for producing statistical or data graphics, and is completely different from other graphics packages. This package functions under grammar called the grammar of graphics, which is made up of a set of independent components that can be composed in many ways. Grammar of graphics is the only thing that makes ggplot2 very powerful, because the user is not limited to a set of prespecified graphics that are used in other libraries. The grammar includes a simple set of core principles that render ggplot2 relatively easy to learn.
In 2005, Wilkinson coined the concept of grammar of graphics in order to describe the deep features that underpin all statistical graphics. The concept focuses on the primacy of layers, which includes adapting features embedded with R. So, what does the grammar of graphics...