library (ggplot2)
##Polar Plot
#mtcars %>%
#dplyr::group_by(cyl) %>%
#dplyr::summarize(mpg = median(mpg)) %>%
#ggplot(aes(x = cyl, y = mpg)) + geom_col(aes(fill =cyl), color = NA) + labs(x = "", y = "Median mpg") + coord_polar()
##Bump Chart
ggplot(mtcars, aes(x = hp, y = mpg, group = cyl))+ geom_line(aes(color = cyl), size = 2) + geom_point(aes(color = cyl), size = 4) + scale_y_reverse(breaks = 1:nrow(mtcars))
##Pairplot with ggpairs
#library(GGally)
#ggpairs(mtcars)
##ggally
#library(GGally)
#ggpairs(mtcars,columns = 1:4,aes(color = cyl, alpha = 0.5))
##Contour Plot
ggplot(mtcars, aes(mpg, hp)) + geom_density_2d_filled(show.legend = FALSE) + coord_cartesian(expand = FALSE) + labs(x = "mpg")
##Correlogram
library(ggcorrplot)
data(mtcars)
corr <- round(cor(mtcars), 1)
ggcorrplot(corr, hc.order = TRUE, type = "lower", lab = TRUE, lab_size = 3, method="circle", colors = c("tomato2", "white", "springgreen3"), title="Correlogram of mtcars", ggtheme=theme_bw)
To embed this program on your website, copy the following code and paste it into your website's HTML: