From 8170f7c4f918abe40d9e593140824143a007486a Mon Sep 17 00:00:00 2001 From: Hadley Wickham Date: Mon, 8 Feb 2021 12:11:28 -0600 Subject: [PATCH] Add missing assignment --- model-many.Rmd | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/model-many.Rmd b/model-many.Rmd index f3a56f7..db0a463 100644 --- a/model-many.Rmd +++ b/model-many.Rmd @@ -207,10 +207,11 @@ broom::glance(nz_mod) We can use `mutate()` and `unnest()` to create a data frame with a row for each country: ```{r} -by_country %>% +glance <- by_country %>% mutate(glance = map(model, broom::glance)) %>% - select(-data, -model, -resids) %>% # removing the unnecessary list columns + select(country, continent, glance) %>% unnest(glance) +glance ``` (Pay attention to the variables that aren't printed: there's a lot of useful stuff there.)