#' @title grob_binder
#' @description Function to rbind ggplotGrob and tableGrob. The tableGrob will be placed on the bottom
#'
#' @param ggrob ggplotGrob object
#' @param tgrob tableGrob object
#'
#' @return Returns grob that can be output.
#' @export
grob_binder <- function(ggrob, tgrob) {
tgrob$heights <- unit.pmax(tgrob$heights)
tgrob$widths <- unit(rep(1/ncol(tgrob), ncol(tgrob)), 'npc')
ggrob %<>% gtable_add_rows(., sum(tgrob$heights))
ggrob %<>% gtable_add_grob(., grobs = tgrob, t = nrow(ggrob),
l = 4, b = nrow(ggrob), r = 4)
return(ggrob)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.