I am struggling with the bubble chart. I wanted to use a third variable (total_allegations) to impact the size of the bubble.
My code is the following:
p <- plot_ly(sample, x = ~year, y = ~MktCap, type = 'scatter', mode = 'markers',
marker = list(size = ~total_allegations))%>%
layout(title = 'Total number of allegations',
xaxis = list(showgrid = FALSE),
yaxis = list(showgrid = FALSE),
showlegend = FALSE)