How ggplot is different from basic plotting function in R?

ggplot2

#1

I am currently studying about visualization in R, while studying it I have read about the package called ggplot2.which helps in plotting in R by adding the layer to existing plot.I want to know how ggplot is different from basic plotting function in R and how ggplot add advantages to the basic plotting in R.


#2

hello @harry,

ggplot2 offers many advanced capabilities.For example:

ggplot(data = store_sales_time, aes(store_type,fill = store_type,stat = "identiy"))+
                                            geom_bar(aes(x = store_type,fill = store_type,stat = "identiy"))

This creates a bar chart with different colors as shown below:

for a better understanding go through http://docs.ggplot2.org/current/


#3

basic R -

  1. mapping of data properties to visual properties is its own special case.
    2)Graphics composed of simple elements like points, line.
    3)Difficult to add elements to existing plot.

ggplot2 - the mapping of data properties to visual properties is done by adding layers to the plot.

These are the merits of ggplot and demerits of basic plotting function in R.

Hope this helps!

Regards,
Hinduja