07 January 2021

1.0 Executive Summary

  1.  A simple demonstration of a R Markdown presentation with plotly.  
  2.  Data set - diamonds.  
  3.  plotly with labels on hover.

3.0 The Code

library(plotly)
d <- diamonds[sample(nrow(diamonds), 1000), ]
fig <- plot_ly(d, x = ~carat, y = ~price,
        text = ~paste("Price: ", price, '$<br>Cut:', cut),  # Hover text:
        color = ~carat, size = ~carat)

3.0 The Plot

fig

07 January 2021