dorem()
fits a model.
dorem(x, ...) # S3 method for default dorem(x, ...) # S3 method for data.frame dorem(x, y, ...) # S3 method for matrix dorem(x, y, ...) # S3 method for formula dorem(formula, data, ...) # S3 method for recipe dorem(x, data, ...)
x | Depending on the context:
|
---|---|
... | Not currently used, but required for extensibility. |
y | When
|
formula | A formula specifying the outcome terms on the left-hand side, and the predictor terms on the right-hand side. |
data | When a recipe or formula is used,
|
A dorem
object.
require(tidyverse)#>#>#> ✓ ggplot2 3.3.2 ✓ purrr 0.3.4 #> ✓ tibble 3.0.3 ✓ dplyr 1.0.1 #> ✓ tidyr 1.1.1 ✓ stringr 1.4.0 #> ✓ readr 1.3.1 ✓ forcats 0.5.0#> Warning: package ‘tidyr’ was built under R version 4.0.2#> Warning: package ‘dplyr’ was built under R version 4.0.2#> Conflicts ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────── tidyverse_conflicts() ── #> x dplyr::filter() masks stats::filter() #> x dplyr::lag() masks stats::lag()data("bike_score") banister_model <- dorem( Test_5min_Power ~ BikeScore, bike_score, method = "banister" )#>#>#>bike_score$pred <- predict(banister_model, bike_score)$.pred ggplot(bike_score, aes(x = Day, y = pred)) + theme_bw() + geom_line() + geom_point(aes(y = Test_5min_Power), color = "red") + ylab("Test 5min Power")#> Warning: Removed 156 rows containing missing values (geom_point).