R Plotly animated chart only showing groups with data in initial frame
问题 I'm trying to create an animated bubble chart using plotly in R, and I've run into a particularly difficult issue. library(plotly) dates <- 2000:2010 countries <- c("US", "GB", "JP") df <- merge(dates, countries, all=TRUE) names(df) <- c("Date", "Country") df$x <- rnorm(nrow(df)) df$y <- rnorm(nrow(df)) df[1:3, c("x", "y")] <- NA p <- plot_ly(df, x=~x, y=~y, color=~Country, frame=~Date, type="scatter", mode="markers") p Due to the missing values for the US' first 3 years, the resulting plot