A simple demonstration of a R Markdown presentation with plotly.
Data set - diamonds.
plotly with labels on hover.
07 January 2021
A simple demonstration of a R Markdown presentation with plotly.
Data set - diamonds.
plotly with labels on hover.
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)
fig
07 January 2021