Could subplot have explicit error when ncols is passed?
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 2.7k
- Forks
- 641
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the supplied R example at the subplot entry point and inspect how the ncols argument is handled. Done means passing ncols no longer produces the subscript-out-of-bounds error and instead gives a clear, intentional message; consider the existing subplot behavior described in the issue when checking the result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100