Skip to content

Commit 3725810

Browse files
authored
document that main arguments are captured as quosures (#918)
1 parent 9dcfcf0 commit 3725810

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+289
-0
lines changed

R/auto_ml.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#' @param engine A single character string specifying what computational engine
1818
#' to use for fitting.
1919
#'
20+
#' @templateVar modeltype auto_ml
2021
#' @template spec-details
2122
#'
2223
#' @template spec-references

R/bag_mars.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#'
1515
#' @inheritParams mars
1616
#'
17+
#' @templateVar modeltype bag_mars
1718
#' @template spec-details
1819
#'
1920
#' @template spec-references

R/bag_mlp.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#'
1313
#' @inheritParams mlp
1414
#'
15+
#' @templateVar modeltype bag_mlp
1516
#' @template spec-details
1617
#'
1718
#' @template spec-references

R/bag_tree.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#' factor is the minority class. If this is not the case, values between zero
1717
#' and one can be used to bias to the second level of the factor.
1818
#'
19+
#' @templateVar modeltype bag_tree
1920
#' @template spec-details
2021
#'
2122
#' @template spec-references

R/bart.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#' terminal node for different values of these parameters.
3636
#'
3737
#'
38+
#' @templateVar modeltype bart
3839
#' @template spec-details
3940
#'
4041
#' @template spec-references

R/boost_tree.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#' @param stop_iter The number of iterations without improvement before
4040
#' stopping (specific engines only).
4141
#'
42+
#' @templateVar modeltype boost_tree
4243
#' @template spec-details
4344
#'
4445
#' @template spec-references

R/c5_rules.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
#'
3131
#' @references Quinlan R (1993). _C4.5: Programs for Machine Learning_. Morgan
3232
#' Kaufmann Publishers.
33+
#'
34+
#' @templateVar modeltype C5_rules
3335
#' @template spec-details
3436
#'
3537
#' @template spec-references

R/cubist_rules.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
#' where `t` is the training set prediction and `w` is a weight that is inverse
5151
#' to the distance to the neighbor.
5252
#'
53+
#' @templateVar modeltype cubist_rules
5354
#' @template spec-details
5455
#'
5556
#' @template spec-references

R/decision_tree.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#' @param min_n An integer for the minimum number of data points
2020
#' in a node that are required for the node to be split further.
2121
#'
22+
#' @templateVar modeltype decision_tree
2223
#' @template spec-details
2324
#'
2425
#' @template spec-references

R/discrim_flexible.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#' @param prod_degree The highest possible interaction degree.
1919
#' @param prune_method The pruning method.
2020
#'
21+
#' @templateVar modeltype discrim_flexible
2122
#' @template spec-details
2223
#'
2324
#' @template spec-references

R/discrim_linear.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#' estimation. Possible values are: "`diagonal`", "`min_distance`",
2323
#' "`shrink_cov`", and "`shrink_mean`" (`sparsediscrim` engine only).
2424
#'
25+
#' @templateVar modeltype discrim_linear
2526
#' @template spec-details
2627
#'
2728
#' @template spec-references

R/discrim_quad.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#' estimation. Possible values are: "`diagonal`", "`shrink_cov`", and
2121
#' "`shrink_mean`" (`sparsediscrim` engine only).
2222
#'
23+
#' @templateVar modeltype discrim_quad
2324
#' @template spec-details
2425
#'
2526
#' @template spec-references

R/discrim_regularized.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#' used. Other regularization methods can be used with [discrim_linear()] and
3434
#' [discrim_quad()] can used via the `sparsediscrim` engine for those functions.
3535
#'
36+
#' @templateVar modeltype discrim_regularized
3637
#' @template spec-details
3738
#'
3839
#' @template spec-references

R/gen_additive_mod.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#' @param adjust_deg_free If `select_features = TRUE`, then acts as a multiplier
1818
#' for smoothness. Increase this beyond 1 to produce smoother models.
1919
#'
20+
#' @templateVar modeltype gen_additive_mod
2021
#' @template spec-details
2122
#'
2223
#' @template spec-references

R/linear_reg.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#'
2727
#' Available for specific engines only.
2828
#'
29+
#' @templateVar modeltype linear_reg
2930
#' @template spec-details
3031
#'
3132
#' @template spec-references

R/logistic_reg.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#' Available for specific engines only. For `LiblineaR` models, `mixture` must
3131
#' be exactly 1 or 0 only.
3232
#'
33+
#' @templateVar modeltype logistic_reg
3334
#' @template spec-details
3435
#'
3536
#' @details This model fits a classification model for binary outcomes; for

R/mars.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#' @param prod_degree The highest possible interaction degree.
1919
#' @param prune_method The pruning method.
2020
#'
21+
#' @templateVar modeltype mars
2122
#' @template spec-details
2223
#'
2324
#' @template spec-references

R/mlp.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#' "linear" or "softmax" depending on the type of outcome. Possible values are:
2424
#' "linear", "softmax", "relu", and "elu"
2525
#'
26+
#' @templateVar modeltype mlp
2627
#' @template spec-details
2728
#'
2829
#' @template spec-references

R/multinom_reg.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#'
3131
#' Available for specific engines only.
3232
#'
33+
#' @templateVar modeltype multinom_reg
3334
#' @template spec-details
3435
#'
3536
#' @details This model fits a classification model for multiclass outcomes; for

R/naive_Bayes.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#' @param Laplace A non-negative value for the Laplace correction to smoothing
2121
#' low-frequency counts.
2222
#'
23+
#' @templateVar modeltype naive_Bayes
2324
#' @template spec-details
2425
#'
2526
#' @template spec-references

R/nearest_neighbor.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#' @param dist_power A single number for the parameter used in
2323
#' calculating Minkowski distance.
2424
#'
25+
#' @templateVar modeltype nearest_neighbor
2526
#' @template spec-details
2627
#'
2728
#' @template spec-references

R/pls.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#' This value is used for all PLS components for X.
1717
#' @param num_comp The number of PLS components to retain.
1818
#'
19+
#' @templateVar modeltype pls
1920
#' @template spec-details
2021
#'
2122
#' @template spec-references

R/poisson_reg.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#'
2525
#' Available for `glmnet` and `spark` only.
2626
#'
27+
#' @templateVar modeltype poisson_reg
2728
#' @template spec-details
2829
#'
2930
#' @template spec-references

R/proportional_hazards.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#' @param mode A single character string for the prediction outcome mode.
1616
#' The only possible value for this model is "censored regression".
1717
#'
18+
#' @templateVar modeltype proportional_hazards
1819
#' @template spec-details
1920
#'
2021
#' @template spec-survival

R/rand_forest.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#' @param min_n An integer for the minimum number of data points
2121
#' in a node that are required for the node to be split further.
2222
#'
23+
#' @templateVar modeltype rand_forest
2324
#' @template spec-details
2425
#'
2526
#' @template spec-references

R/rule_fit.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#' @references Friedman, J. H., and Popescu, B. E. (2008). "Predictive learning
2323
#' via rule ensembles." _The Annals of Applied Statistics_, 2(3), 916-954.
2424
#'
25+
#' @templateVar modeltype rule_fit
2526
#' @template spec-details
2627
#'
2728
#' @template spec-references

R/surv_reg.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#' @param dist A character string for the probability distribution of the
2121
#' outcome. The default is "weibull".
2222
#'
23+
#' @templateVar modeltype surv_reg
2324
#' @template spec-details
2425
#'
2526
#' @template spec-survival

R/survival_reg.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#' outcome. The default is "weibull".
1717
#'
1818
#'
19+
#' @templateVar modeltype survival_reg
1920
#' @template spec-details
2021
#'
2122
#' @template spec-survival

R/svm_linear.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#' @param margin A positive number for the epsilon in the SVM insensitive
2020
#' loss function (regression only)
2121
#'
22+
#' @templateVar modeltype svm_linear
2223
#' @template spec-details
2324
#'
2425
#' @template spec-references

R/svm_poly.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#' @param margin A positive number for the epsilon in the SVM insensitive
2323
#' loss function (regression only)
2424
#'
25+
#' @templateVar modeltype svm_poly
2526
#' @template spec-details
2627
#'
2728
#' @template spec-references

R/svm_rbf.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#' @param margin A positive number for the epsilon in the SVM insensitive
2525
#' loss function (regression only)
2626
#'
27+
#' @templateVar modeltype svm_rbf
2728
#' @template spec-details
2829
#'
2930
#' @template spec-references

man-roxygen/spec-details.R

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,12 @@
66
#'
77
#' The model is not trained or fit until the [`fit()`][fit.model_spec()] function is used
88
#' with the data.
9+
#'
10+
#' Each of the arguments in this function other than `mode` and `engine` are
11+
#' captured as [quosures][rlang::`topic-quosure`]. To pass values
12+
#' programmatically, use the [injection operator][rlang::`!!`] like so:
13+
#'
14+
#' ``` r
15+
#' value <- 1
16+
#' <%= modeltype %>(argument = !!value)
17+
#' ```

man/C5_rules.Rd

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/auto_ml.Rd

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/bag_mars.Rd

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/bag_mlp.Rd

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/bag_tree.Rd

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/bart.Rd

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/boost_tree.Rd

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/cubist_rules.Rd

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/decision_tree.Rd

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)