### Necessary package is loaded
library(plotly)
Data from a case-control study of (o)esophageal cancer in Ille-et-Vilaine, France.
The following is a 3d scatterplot showing the number of cases of (o)esophageal cancer based on alcohol and tobacco consumption, and divided by their respective age groups.
data(esoph)
plot_ly(x= esoph$alcgp, y= esoph$ncases, z = esoph$tobgp,
type = "scatter3d", color = esoph$agegp) %>% layout(title="Number of Cases (O)esophageal Cancer based on Alcohol and Tobacco consumption", scene=list(xaxis = list(title="Alcohol consumption"), yaxis = list(title="Number of cases"), zaxis = list(title="Tobacco consumption")))