library(tidyverse)
diamonds %>%
ggplot(aes(x= carat, y=price, color = color)) +
geom_point() +
facet_wrap(~ clarity, nrow = 2) +
ggtitle("Diamonds Attributes and Value",
subtitle = "Diamond value variation by carat, color, and clarity")
The figure above depicts the relationship between price and diamond attributes including size (carat), color, and clarity. Diamond cut was excluded from this figure as it was least correlated with price, and adding it to the figure reduced the readability of the figure. As the figure shows, generally, price goes up when diamond size increases regardless of its color and clarity. Zooming in individual figures, the distribution patterns of color, price, and carat are the same. Specifically, for diamonds of a similar price, color compensates diamond size to some extent, meaning that diamonds with a better color could value similarly to diamonds with larger size but less good color. Moreover, the slopes of the individual figures suggest that clarity also compensates diamond size, meaning that diamonds with a better clarity could be worth equally to diamonds with larger size but less good clarity.