R Error: First argument, `data`, must be a data frame or shared data
问题 I am using the R programming language. I am following this tutorial over here: https://plotly.com/r/dropdowns/ I tried to create my own data and run the same procedure: library(plotly) library(MASS) library(dplyr) # create data x <- sample( LETTERS[1:4], 731, replace=TRUE, prob=c(0.25, 0.25, 0.25, 0.25) ) y <- rnorm(731,10,10) z <- rnorm(731,5,5) date= seq(as.Date("2014/1/1"), as.Date("2016/1/1"),by="day") df <- data.frame(x,y, z, date) df$x = as.factor(df$x) #create plot fig <- plot_ly(df, x