library(MASS) ############i am going to do a ggplot. mtcars## sample data to be used

str(mtcars) ######## It provides easier way to look at the given data set. and its more in structured way

it contain 11 variables and 32 observation

summary(mtcars) #### summary provides minimum,maximum,mean,median 1st and 3rd quartile og all the 11 variables in the sample taken.

library(ggplot2)

a<-ggplot(mtcars,aes(mpg,gear))#doing ggplot for mpg,gear.

a+geom_point()+ ###this command create scatter plot for mpg,gear.

a+geom_point(aes(colour=mpg)) #### this command provides colour to mpg variable.

a+geom_point(aes(colour=factor(mpg))) #### this command provide colour to each factors of mpg.

a+geom_point(aes(size=mpg)) ### this command locates the each value in mpg based on their size so its easy to locate and visually see where each data is spread…