spsanderson / tidyAML

Auto ML for the tidyverse
http://www.spsanderson.com/tidyAML/
Other
64 stars 7 forks source link

`create_model_spec()` #148

Closed spsanderson closed 10 months ago

spsanderson commented 10 months ago

documentation says you can pass something like:

.parsnip_eng = c('lm', 'glm')

This in-fact fails with the following message:

> create_model_spec(.parsnip_eng = c('lm','glm'))
Error in `purrr::list_c()` at tidyAML/R/make-model-spec.R:57:2:
! `x` must be a list, not a character vector.
Run `rlang::last_trace()` to see where the error occurred.

Fix documentation to show that a list object must be passed only.

This means that the following can also be fixed:

  # Tidyeval ----
  engine <- .parsnip_eng |>
    purrr::list_c() |>
    as.list()
  mode <- .mode |>
    purrr::list_c() |>
    as.list()
  call <- .parsnip_fns |>
    purrr::list_c() |>
    as.list()

And can be made as follows:

  # Tidyeval ----
  engine <- .parsnip_eng
  mode <- .mode
  call <- .parsnip_fns