ggplot2 Visualizations

Using the diamonds, ** dataset, the following visualizations are examples of what can be done using ggplot2.

ggplot(diamonds, aes(x = diamonds$carat, y=diamonds$price, col = diamonds$cut)) +
  geom_point() +
  labs(title = "geom_point()", x = "Carat", y = "Price", col = "Cut")

ggplot(diamonds, aes(x = diamonds$carat, y=diamonds$price, col = diamonds$cut)) +
  geom_smooth(se = FALSE) +
  labs(title = "geom_smooth()", x = "Carat", y = "Price", col = "Cut")

ggplot(diamonds, aes(x = diamonds$cut, y=diamonds$price, fill = diamonds$cut)) +
  geom_boxplot() +
  labs(title = "geom_boxplot()", x = " ", y = "Price", fill = "Cut")

ggplot(diamonds, aes(x = diamonds$cut, y=diamonds$price, fill = diamonds$cut)) +
  geom_violin() +
  labs(title = "geom_violin()", x = " ", y = "Price", fill = "Cut")

ggplot(diamonds, aes(x = diamonds$cut, y=diamonds$price, col = diamonds$cut)) +
  geom_jitter() +
  labs(title = "geom_jitter()", x = " ", y = "Price", col = "Cut")

ggplot(diamonds, aes(x = diamonds$cut, fill = cut)) +
  geom_density() +
  labs(title = "geom_density()", x = " ", y = "Density", fill = "Cut")