Skip to content

Instantly share code, notes, and snippets.

@njtierney
Created February 17, 2017 06:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save njtierney/aff88d1cb182c959b436154f48faf1e6 to your computer and use it in GitHub Desktop.
Save njtierney/aff88d1cb182c959b436154f48faf1e6 to your computer and use it in GitHub Desktop.
Gist of a little function for tidying the results of inla
# broom tidy method for class "inla"
tidy.inla <- function(x){
# x = model_inla
term_names <- rownames(x$summary.fixed)
tibble::as_tibble(x$summary.fixed) %>%
dplyr::mutate(terms = term_names) %>%
dplyr::select(terms,
dplyr::everything())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment