R Markdown
summary(cars)
## speed dist
## Min. : 4.0 Min. : 2.00
## 1st Qu.:12.0 1st Qu.: 26.00
## Median :15.0 Median : 36.00
## Mean :15.4 Mean : 42.98
## 3rd Qu.:19.0 3rd Qu.: 56.00
## Max. :25.0 Max. :120.00
library(ggplot2)
ggplot(mpg, aes(class,fill=trans)) + geom_bar()+ guides (title="Transmission")

ggplot(mpg,aes(manufacturer,hwy))+geom_boxplot()+coord_flip()+
labs(y="Highway Fuel Efficiency(miles/gallon) ",
x="Vehicle Manufacturer")

library("ggthemes")
ggplot(diamonds, aes(x=price,color=cut,fill=cut)) + geom_density(aes(fill=factor(cut)), alpha= 0.7) +labs(title="Diamond Price Density ", x="Diamond Price", y="Density")

ggplot(iris, aes(x = Sepal.Length, y = Petal.Length)) + geom_smooth(method = "lm")+ geom_point(position = "jitter")+ labs(title="Relationship between Petal and Sepal Length", x="Sepal Length", y=" Petal Length")
