Density, Boxplot, Violinplot, Scatterplot
Density, Boxplot, Violinplot, Scatterplot
data(mpg)
mpg
theme_set(theme_classic())
#density plot
g <- ggplot(mpg,aes(cty))
g+geom_density(aes(fill=factor(cyl)),alpha = 0.8) + labs(title="Density Plot", subtitle= "City Milleage
Grouped by Number of Cylinders", caption = "Source:mpg", x = "City Mileage", fill = "#Cylinders")
#Boxplot
g <- ggplot(mpg, aes(class,cty))
g+geom_boxplot(varwidth=T, fill= "violet")+
labs(title="Boxplot", subtitle= "City Mileage Grouped by Class of Vehicle",
caption="Source:mpg",
x="Class of Vehicle",
y = "City Mileage",
fill="City Mileage")
# Violin Plot
g <- ggplot(mpg, aes(class,cty))
g+geom_violin(fill = "violet")+
labs(title="Violin Plot", subtitle= "City Mileage Grouped by Class of Vehicle",
caption="Source:mpg",
x="Class of Vehicle",
y = "City Mileage")
# Scatterplot
data <- read.csv("D:\\eda16418.csv", header = TRUE)
data
# Scatterplot-RColorBrewer
library(RColorBrewer)
par(mfrow=c(2,2))
plot(x=data$Advertis, y=da
plot(x=data$Advertis, y=da
plot(x=data$Advertis, y=da
plot(x=data$Advertis, y=da