Closed ArtemSokolov closed 2 years ago
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.
Dear developers,
In a recent Stack Overflow question, it became apparent that
hchart()
is not handling quosures properly. I proposed a workaround involvingensym()
, but @lionel- (one of the tidyeval leads) suggested that we submit a bug report, since ideally the highcharter functionality should work with quosures also.I tracked the issue down to the following place in
mutate_mapping()
: https://github.com/jbkunst/highcharter/blob/d47a7792577588d0891dfd87a14a60914371e8c3/R/highcharts-api-add.R#L412-L416where the list of expressions captured by
haes()
gets converted to character and then parsed back to expressions after getting annotated with names. This works well for expressions, but fails for quosures, which end up getting reinterpreted as formulas by this chain of operations.As far as I can tell, the conversion to character is not really necessary, because
mapping
is already a named list. Therefore, lines 412-414 can be omitted, and line 416 can be replaced to usemapping
directly:A quick reprex using the data from the SO question referenced above: