Closed hfrick closed 2 years ago
Duplicate of #153 it seems
library(dials)
#> Loading required package: scales
# Laplace has a range argument but has a hardcoded default
x <- Laplace()
x$range
#> $lower
#> [1] 0
#>
#> $upper
#> [1] 3
x$default
#> [1] 0
# So if you change the range...
x2 <- range_set(x, c(1, 3))
# You can end up with a default that is out of sync with the range
x2$range
#> $lower
#> [1] 1
#>
#> $upper
#> [1] 3
x2$default
#> [1] 0
# We also have `range_validate()` which doesn't currently check the `default`
# either
# One option is to add a `default` arg to `range_set()` and all dials parameter
# helper functions and always require that they stay in sync
# range_set(x, c(1, 3), default = 2)
# Laplace(range = c(1, 3), default = 2)
# However, this is a lot of work for one thing, and is honestly a little more
# frustrating to use (because you have to think about the default so much).
# Since `default` is only used in `value_seq()` when `n == 1`, maybe we can
# just remove it?
# - When is `n == 1` used in practice?
Created on 2022-04-28 by the reprex package (v2.0.1)
note to self: we decided to deprecate the default
argument
This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.
via @DavisVaughan
Created on 2022-04-21 by the reprex package (v2.0.1)