Exercise

Returning many things

Functions can only return one value. If you want to return multiple things, then you can store them all in a list.

If users want to have the list items as separate variables, they can assign each list element to its own variable using zeallot's multi-assignment operator, %<-%.

glance(), tidy(), and augment() each take the model object as their only argument.

The Poisson regression model of Snake River visits is available as model. broom and zeallot are loaded.

Instructions 1/3

undefined XP
    1
    2
    3
  • Examine the structure of model.
  • Use broom functions on model to create a list containing the model-, coefficient-, and observation-level parts of model.