Closed juliasilge closed 4 years ago
This now causes an error:
library(dials)
#> Loading required package: scales
p <- parameters(penalty(), mixture(), neighbors())
grid_regular(p, levels = c(2, penalty = 5, 6))
#> Error: Elements of `levels` should either be all named or unnamed, not mixed.
Created on 2020-06-09 by the reprex package (v0.3.0.9001)
This pull request 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.
Closes #105.
This PR changes how the
levels
argument handles names; if names exist and match the parameter names, they are matched up before we map across both withmap2()
. There are also two little tests and some updated docs.The right number of levels now gets assigned to the right parameter, no matter what order they are in the named vector:
Created on 2020-06-08 by the reprex package (v0.3.0.9001)