tidy.inla <- function(x){
# x = model_inla
term_names <- rownames(x$summary.fixed)
re_term_names <- rownames(x$summary.hyperpar)
tibble::as_tibble(bind_rows(x$summary.fixed, x$summary.hyperpar)) %>%
dplyr::mutate(terms = c(term_names, re_term_names)) %>%
dplyr::select(terms,
dplyr::everything())
}
Putting this here as a stub/inspiration for when I have more time, but, starting to think about this along the lines of https://gist.github.com/njtierney/aff88d1cb182c959b436154f48faf1e6
Such as