plotly.R
plotly.R copied to clipboard
Could subplot have explicit error when ncols is passed?
I just tried to use subplot in a shiny app, and naively assumed that there would be an ncols argument corresponding to nrows - evidently, that is not really needed, but an error message clearer than Error in [[: subscript out of bounds would have saved me a lot of confusion. Might still be worth making this explicit? (Or - though that might be too much of a change - require all ... arguments to be unnamed?)
library(plotly)
p1 <- plot_ly(economics, x = ~date, y = ~uempmed)
p2 <- plot_ly(economics, x = ~date, y = ~unemploy)
subplot(p1, p2, ncols = 2)
#> Error in plots[[i]][["frames"]]: subscript out of bounds
Created on 2024-05-09 with reprex v2.0.2