Open mmmmtoasty19 opened 4 years ago
Please see my newest commit, I have a solution, but its not the prettiest.
sorry, @mmmmtoasty19 , for not replying fast enough. You have found the solution I would recommend
mutate(model = purrr::map(data, age_model)) %>%
unnest(data) %>%
mutate(slope = purrr::map(model,`[`, "coefficients")
,slope = purrr::map(slope, unlist)
,slope = as.numeric(purrr::map(slope,2))) %>%
ungroup ()
I don't think there is an easier way to get a slope. Besides, this is a more transparent solution, as it captures these estimates. Also think about other parameters that might be useful in classifying the trajectory of individual groups, such as the total amount of change in the observed period of time. A slope may be just the easiest way of quantify change, we may need to develop a more nuanced measure and in that case, creating a separate data frame that captures these features of a group is the way to go.
@andkov any idea how we can pull the slope out of the geom_smooth, or generate our own slope. If we have that data then highlighting is easy. I have spent about 2 hours trying to figure this one out and I keep struggling