library(RColorBrewer)
data(VADeaths)
par(mfrow=c(2,3))
hist(VADeaths,breaks=10, col=brewer.pal(3,"Set3"),main="Set3 3 colors")
hist(VADeaths,breaks=3 ,col=brewer.pal(3,"Set2"),main="Set2 3 colors")
hist(VADeaths,breaks=7, col=brewer.pal(3,"Set1"),main="Set1 3 colors")
hist(VADeaths,,breaks= 2, col=brewer.pal(8,"Set3"),main="Set3 8 colors")
hist(VADeaths,col=brewer.pal(8,"Greys"),main="Greys 8 colors")
hist(VADeaths,col=brewer.pal(8,"Greens"),main="Greens 8 colors")

plot(AirPassengers,type="l") #Simple Line Plot

barplot(iris$Petal.Length) #Creating simple Bar Graph

barplot(iris$Sepal.Length,col = brewer.pal(3,"Set1"))

barplot(table(iris$Species,iris$Sepal.Length),col = brewer.pal(3,"Set1")) #Stacked Plot

boxplot(iris$Petal.Length~iris$Species) #Creating Box Plot between two variable

data(iris)
par(mfrow=c(2,2))
boxplot(iris$Sepal.Length,col="red")
boxplot(iris$Sepal.Length~iris$Species,col="red")
boxplot(iris$Sepal.Length~iris$Species,col=heat.colors(3))
boxplot(iris$Sepal.Length~iris$Species,col=topo.colors(3))

plot(x=iris$Petal.Length) #Simple Scatter Plot

plot(x=iris$Petal.Length,y=iris$Species) #Multivariate Scatter Plot

plot(iris,col=brewer.pal(3,"Set1"))

pie(table(iris$Species))

library(hexbin)
## Warning: package 'hexbin' was built under R version 3.4.3
library(ggplot2)
## Warning: package 'ggplot2' was built under R version 3.4.2
a=hexbin(diamonds$price,diamonds$carat,xbins=40)
library(RColorBrewer)
plot(a)

library(RColorBrewer)
rf <- colorRampPalette(rev(brewer.pal(40,'Set3')))
## Warning in brewer.pal(40, "Set3"): n too large, allowed maximum for palette Set3 is 12
## Returning the palette you asked for with that many colors
hexbinplot(diamonds$price~diamonds$carat, data=diamonds, colramp=rf)

data(HairEyeColor)
mosaicplot(HairEyeColor)

heatmap(as.matrix(mtcars))

image(as.matrix(mtcars[2:7]))

library(magrittr)
## Warning: package 'magrittr' was built under R version 3.4.2
library(leaflet)
## Warning: package 'leaflet' was built under R version 3.4.3
m <- leaflet() %>%
addTiles() %>% # Add default OpenStreetMap map tiles
addMarkers(lng=80.2246, lat=12.9796, popup="THe Beautiful House of Sathiya")
m # Print the map
data(iris, package="datasets")
library(rgl)
## Warning: package 'rgl' was built under R version 3.4.3
library(car)
## Warning: package 'car' was built under R version 3.4.2
scatter3d(Petal.Width~Petal.Length+Sepal.Length|Species, data=iris, fit="linear")
library(lattice)
xyplot(Sepal.Width ~ Sepal.Length, iris, groups = iris$Species, pch= 20)

cor(iris[1:4])
## Sepal.Length Sepal.Width Petal.Length Petal.Width
## Sepal.Length 1.0000000 -0.1175698 0.8717538 0.8179411
## Sepal.Width -0.1175698 1.0000000 -0.4284401 -0.3661259
## Petal.Length 0.8717538 -0.4284401 1.0000000 0.9628654
## Petal.Width 0.8179411 -0.3661259 0.9628654 1.0000000
library(corrgram)
## Warning: package 'corrgram' was built under R version 3.4.3
corrgram(iris)
