Problem: All values of aesthetically mapped variable not displayed, I mapped the variable 'class' of mpg data set of ggplot2, but the plotly function is not displaying all of them.
Here is the code:
library(ggplot2)
library(plotly)
# using mpg data set, already loaded as a part of ggplot2
fig<-plot_ly(mpg,x=~cty, y=~hwy,
color=~drv,
frame = ~class,
type="scatter",
mode="markers")
fig
Below is the screenshot, following warning was shown:
Warning message: In p$x$data[firstFrame] <- p$x$frames[[1]]$data : number of items to replace is not a multiple of replacement length
The 'drv ' has three distinct values '4', 'f', 'r' , only r is being shown.