scales
scales copied to clipboard
fix bug in `label_number` when `scale_cut` argument is provided (#413)
This pull request resolves #413, implementing the fix proposed by @jbengler (link)
Behaviour in 1.3.0:
> scales::label_number(scale_cut = scales::cut_short_scale())(c(0,500,1500,2000,2500))
Error in break_suffix[bad_break][improved_break & !power10_break] <- names(lower_break[improved_break & :
NAs are not allowed in subscripted assignments
Behaviour after change (as expected):
> scales::label_number(scale_cut = scales::cut_short_scale())(c(0,500,1500,2000,2500))
[1] "0" "500" "1.5K" "2.0K" "2.5K"
This change does not break any package tests, and I have added an additional test against this behaviour.
[ FAIL 0 | WARN 0 | SKIP 0 | PASS 597 ]
What's the status on this? Still seeing this problem and the workaround to revert to 1.2.1 isn't working for me.
I am also curious what the status of this PR is, as I run into this issue daily.
If you're in need of this PR now, you can use pak::pak("https://github.com/r-lib/scales/pull/420") to install it.
I'm still seeing this error when I try scale_y_continuous(labels=scales::label_number(scale_cut = cut_short_scale())). I can't go back to 1.2.1 and I tried the suggestion by teunbrand to no success
I am still running into this same issue.
Thanks to @teunbrand for the fix! It works for me.
Please pass on any and all thanks to Colin, I'm just the middleperson giving installation hints :)
I'm still seeing this error when I try scale_y_continuous(labels=scales::label_number(scale_cut = cut_short_scale())). I can't go back to 1.2.1 and I tried the suggestion by teunbrand to no success
Also not fixed for me when installing from this PR.