highcharter
highcharter copied to clipboard
check for chart type
When a user forgets to add a type
to hchart
, a non-informative error is thrown:
library(highcharter)
hchart(mtcars, hcaes(x = mpg, y = cyl))
#> Error: Assigned data `type` must be compatible with existing data.
#> x Existing data has 1 row.
#> x Assigned data has 2 rows.
#> i Row updates require a list value. Do you need `list()` or `as.list()`?
#> Warning in if (type == "heatmap") {: Condition has length > 1 and only the first element will be used.
#> 2: In if (type %in% c("bubble", "scatter")) { : Condition has length > 1 and only the first element will be used.
This PR enables the following behaviour:
library(highcharter)
hchart(mtcars, hcaes(x = mpg, y = cyl))
#> Error: Chart type must be provided.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Feel free to reopen it if you find it necessary.