Shiny bright like a diamond

Sam Parmar

Published

September 16, 2025

Plot diamonds dataset

Here’s a plot of the diamonds dataset using ggplot2:

library(ggplot2)
ggplot(diamonds, aes(x = carat, y = price)) +
  geom_point() +
  labs(title = "Scatter plot of Diamond Price vs Carat",
       x = "Carat",
       y = "Price (USD)")

Diamonds metadata is here.