Here's the CSS:
.title-hex{
height: 60px;
align: middle;
float: right;
}
I put this in a css file mtheme_max.css, which is an edit of someone else's file. Then in your iml header:
---
title: "Applied Machine Learning - Resampling and Grid Search"
author: Max Kuhn (RStudio)
output:
xaringan::moon_reader:
css: ["mtheme_max.css", "fonts_mtheme_max.css"]
If you put the png files in a directory called images, then you can have headers using:
# Resampling a 5-NN model `r I(hexes(c("parsnip", "purrr", "dplyr", "rsample")))`
and this function:
hexes <- function(x) {
x <- rev(sort(x))
markup <- function(pkg) glue::glue('<img src="images/{pkg}.png" class="title-hex">')
res <- purrr::map_chr(x, markup)
paste0(res, collapse = "")
}
The CSS probably needs to be more sophisticated; occasionally there are gaps between the images.
(edit) add more info on where to put the css