apd_hat_values()
fits a model.
apd_hat_values(x, ...)
# S3 method for default
apd_hat_values(x, ...)
# S3 method for data.frame
apd_hat_values(x, ...)
# S3 method for matrix
apd_hat_values(x, ...)
# S3 method for formula
apd_hat_values(formula, data, ...)
# S3 method for recipe
apd_hat_values(x, data, ...)
Depending on the context:
A data frame of predictors.
A matrix of predictors.
A recipe specifying a set of preprocessing steps
created from recipes::recipe()
.
Not currently used, but required for extensibility.
A formula specifying the predictor terms on the right-hand side. No outcome should be specified.
When a recipe or formula is used, data
is specified as:
A data frame containing the predictors.
A apd_hat_values
object.
predictors <- mtcars[, -1]
# Data frame interface
mod <- apd_hat_values(predictors)
# Formula interface
mod2 <- apd_hat_values(mpg ~ ., mtcars)
# Recipes interface
library(recipes)
#> Loading required package: dplyr
#>
#> Attaching package: ‘dplyr’
#> The following objects are masked from ‘package:stats’:
#>
#> filter, lag
#> The following objects are masked from ‘package:base’:
#>
#> intersect, setdiff, setequal, union
#>
#> Attaching package: ‘recipes’
#> The following object is masked from ‘package:stats’:
#>
#> step
rec <- recipe(mpg ~ ., mtcars)
rec <- step_log(rec, disp)
mod3 <- apd_hat_values(rec, mtcars)