1717# ' }
1818# ' These arguments are converted to their specific names at the
1919# ' time that the model is fit. Other options and argument can be
20- # ' set using the `others` argument . If left to their defaults
20+ # ' set using the `...` slot . If left to their defaults
2121# ' here (`NULL`), the values are taken from the underlying model
2222# ' functions. If parameters need to be modified, `update` can be used
2323# ' in lieu of recreating the object from scratch.
2424# '
25+ # ' @inheritParams boost_tree
2526# ' @param mode A single character string for the type of model.
2627# ' Possible values for this model are "unknown", "regression", or
2728# ' "classification".
28- # ' @param others A named list of arguments to be used by the
29- # ' underlying models (e.g., `earth::earth`, etc.). If the outcome is a factor
30- # ' and `mode = "classification"`, `others` can include the `glm` argument to
31- # ' `earth::earth`. If this argument is not passed, it will be added prior to
32- # ' the fitting occurs.
3329# ' @param num_terms The number of features that will be retained in the
3430# ' final model, including the intercept.
3531# ' @param prod_degree The highest possible interaction degree.
3632# ' @param prune_method The pruning method.
37- # ' @param ... Used for method consistency. Any arguments passed to
38- # ' the ellipses will result in an error. Use `others` instead.
39- # ' @details Main parameter arguments (and those in `others`) can avoid
33+ # ' @details Main parameter arguments (and those in `...`) can avoid
4034# ' evaluation until the underlying function is executed by wrapping the
4135# ' argument in [rlang::expr()].
4236# '
4640# ' \item \pkg{R}: `"earth"`
4741# ' }
4842# '
43+ # ' @section Engine Details:
44+ # '
4945# ' Engines may have pre-set default arguments when executing the
50- # ' model fit call. These can be changed by using the `others `
46+ # ' model fit call. These can be changed by using the `... `
5147# ' argument to pass in the preferred values. For this type of
5248# ' model, the template of the fit calls are:
5349# '
7167
7268mars <-
7369 function (mode = " unknown" ,
74- ... ,
7570 num_terms = NULL , prod_degree = NULL , prune_method = NULL ,
76- others = list ()) {
77- check_empty_ellipse(... )
71+ ... ) {
72+ others <- enquos(... )
73+ num_terms <- enquo(num_terms )
74+ prod_degree <- enquo(prod_degree )
75+ prune_method <- enquo(prune_method )
7876
7977 if (! (mode %in% mars_modes ))
8078 stop(" `mode` should be one of: " ,
@@ -87,7 +85,7 @@ mars <-
8785 stop(" `num_terms` should be >= 1" , call. = FALSE )
8886 if (! is_varying(prune_method ) &&
8987 ! is.null(prune_method ) &&
90- ! is.character(prune_method ))
88+ is.character(prune_method ))
9189 stop(" `prune_method` should be a single string value" , call. = FALSE )
9290
9391 args <- list (num_terms = num_terms ,
@@ -118,11 +116,8 @@ print.mars <- function(x, ...) {
118116# ------------------------------------------------------------------------------
119117
120118# ' @export
121- # ' @inheritParams mars
119+ # ' @inheritParams update.boost_tree
122120# ' @param object A MARS model specification.
123- # ' @param fresh A logical for whether the arguments should be
124- # ' modified in-place of or replaced wholesale.
125- # ' @return An updated model specification.
126121# ' @examples
127122# ' model <- mars(num_terms = 10, prune_method = "none")
128123# ' model
@@ -134,10 +129,12 @@ print.mars <- function(x, ...) {
134129update.mars <-
135130 function (object ,
136131 num_terms = NULL , prod_degree = NULL , prune_method = NULL ,
137- others = list (),
138132 fresh = FALSE ,
139133 ... ) {
140- check_empty_ellipse(... )
134+ others <- enquos(... )
135+ num_terms <- enquo(num_terms )
136+ prod_degree <- enquo(prod_degree )
137+ prune_method <- enquo(prune_method )
141138
142139 args <- list (num_terms = num_terms ,
143140 prod_degree = prod_degree ,
0 commit comments