2023-08-07

Overview

This output aims to create a web page using R Markdown that features a plot created with Plotly.

Loading the library and data set

Using Plotly and diamonds data set, we will generate an interactive scatter plot and analyze its results

library(plotly)
data <- diamonds[sample(nrow(diamonds), 1000), ]

Creating the plot

We will analyze the diamonds data set and conduct a comparison between the carat and price (in US Dollars) of diamonds.

Insight

By examining the plot, we can notice a clear linear relationship between the carat and price of diamonds. As the carat size increases, there is a corresponding increase in the price. This correlation is evident in the color representation, where the dark green points are plotted at the highest carat sizes and prices.