From 9d6ed46c5eb5fdc25f3b78b9eda9e692df3c3f40 Mon Sep 17 00:00:00 2001 From: Kevin Ferris Date: Mon, 8 Feb 2021 08:31:10 -0800 Subject: [PATCH] Removed reference to deprecated .drop argument (#896) According to the output and documentation, `.drop` was deprecated as an argument. I'd propose just removing this chunk and adding a comment in the original `unnest(glance)` pipeline --- model-many.Rmd | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/model-many.Rmd b/model-many.Rmd index 49d0482..f3a56f7 100644 --- a/model-many.Rmd +++ b/model-many.Rmd @@ -209,18 +209,10 @@ We can use `mutate()` and `unnest()` to create a data frame with a row for each ```{r} by_country %>% mutate(glance = map(model, broom::glance)) %>% + select(-data, -model, -resids) %>% # removing the unnecessary list columns unnest(glance) ``` -This isn't quite the output we want, because it still includes all the list columns. This is default behaviour when `unnest()` works on single row data frames. To suppress these columns we use `.drop = TRUE`: - -```{r} -glance <- by_country %>% - mutate(glance = map(model, broom::glance)) %>% - unnest(glance, .drop = TRUE) -glance -``` - (Pay attention to the variables that aren't printed: there's a lot of useful stuff there.) With this data frame in hand, we can start to look for models that don't fit well: