tidypredict_fit

It parses a model or uses an already parsed model to return a Tidy Eval formula that can then be used inside a dplyr command.

tidypredict_fit(model)

Arguments

model

An R model or a tibble with a parsed model. It currently supports lm(), glm() and randomForest() models.

Examples

library(dplyr) df <- mutate(mtcars, cyl = paste0("cyl", cyl)) model <- lm(mpg ~ wt + cyl * disp, offset = am, data = df) tidypredict_fit(model)
#> (((((((39.4127792009634) + ((wt) * (-1.61917264901457))) + ((ifelse((cyl) == #> ("cyl6"), 1, 0)) * (-18.4170134479827))) + ((ifelse((cyl) == #> ("cyl8"), 1, 0)) * (-16.2066476965851))) + ((disp) * (-0.0929785674850189))) + #> (((disp) * (ifelse((cyl) == ("cyl6"), 1, 0))) * (0.11133890642722))) + #> (((disp) * (ifelse((cyl) == ("cyl8"), 1, 0))) * (0.0879557120382374))) + #> (am)
Skip to content This repository Search Pull requests Issues Marketplace Explore @edgararuiz Sign out Unwatch 9 Star 5 Fork 5 rstudio/db.rstudio.com Code Issues 6 Pull requests 0 Projects 0 Wiki Insights Settings Tree: 7a7548589f Find file Copy pathdb.rstudio.com/themes/hugo-material-docs/layouts/partials/footer_js.html 7a75485 on Apr 22, 2017 @edgararuiz edgararuiz Fix to theme's scrollspy 1 contributor RawBlameHistory 84 lines (73 sloc) 2.83 KB © 2018 GitHub, Inc. Terms Privacy Security Status Help Contact GitHub API Training Shop Blog About