Open mfoos opened 3 weeks ago
The error message gives the valid options. Is the ask here to also allow uppercase, or is the ask here to change the documentation to list the options in full?
Since the implementation still uses the bw.nrd (etc) code under the hood, and the desire is probably to continue to use that existing/precise/citation'd manpage for reference, I think allowing the uppercase options would be the more unifying solution.
The solution would be to use to_lower_ascii()
before using arg_match0()
in the piece of code below:
Hello! This is relatively minor (in that it's easy for a novice to fix, though it's breaking to old code) but I think I am correct that it's in error. I was rerunning some old code that uses
stat_density(..., bw = "SJ")
and I got the errorAnd so I read the stat_density man page, which says bw should be set to:
When you click into the stats manpage (https://stat.ethz.ch/R-manual/R-devel/library/stats/html/bandwidth.html) it shows several SJ options that one can use (bw.SJ, SJ-ste, SJ-dpi). But those are different from the ones in the ggplot2 error message, and indeed when you try them, they fail due to ggplot input checking (reprex below).
I'm not a bleeding-edge updater, but this is happening with R4.3.2 and ggplot2 3.5.1. I'm not in a position to update today, but the stats manpage linked above shows that in R4.5.0 their documentation has not changed. I also did not find any mention of this in the ggplot2 changelog.
Created on 2024-06-12 with reprex v2.1.0