Trying to unnest broom::augment data, but R “can't cast”

给你一囗甜甜゛ 提交于 2020-01-06 05:17:46

问题


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. to model_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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!