| gf_model | R Documentation | 
When teaching about regression it can be useful to visualize the data as a point plot with the
outcome on the y-axis and the explanatory variable on the x-axis. For regression models, this is
most easily achieved by calling gf_lm(), with empty models gf_hline() using the mean,
and a more complicated call to gf_segment() for group models. This function simplifies this
by making a guess about what kind of model you are plotting (empty/null, regression, group) and
then making the appropriate plot layer for it.
gf_model(object, model, ...)
object | 
 A plot created with the   | 
model | 
 A linear model fit by either   | 
... | 
 Additional arguments. Typically these are (a) ggplot2 aesthetics to be set with
  | 
This function only works with models that have a continuous outcome measure.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.