Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could subplot have explicit error when ncols is passed? #2349

Open
LukasWallrich opened this issue May 9, 2024 · 0 comments
Open

Could subplot have explicit error when ncols is passed? #2349

LukasWallrich opened this issue May 9, 2024 · 0 comments

Comments

@LukasWallrich
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant