问题
I can't reproduce the data here, but I'm hoping I'm making an obvious mistake. I am trying to get residuals from all the of the models I fit with purrr::map. My code looks like this:
df %>%
group_by(group) %>%
nest() %>%
mutate(model = map(data, fit_mod),
model_data = map(model, broom::augment)) %>%
ungroup()%>%
unnest(c(data, model_data))
I get an error related to the title of one of the coefficients in my model:
Error: Can't cast
model_data$poly.Actual_Population..2..raw...TRUE.
tomodel_data$poly.Actual_Population..2..raw...TRUE.
.
How can I just pull those residuals out of there? I want to check my models.
来源:https://stackoverflow.com/questions/58531385/trying-to-unnest-broomaugment-data-but-r-cant-cast