#https://community.rstudio.com/t/spread-with-multiple-value-columns/5378
f_spread <- function(df, key, value) {
# quote key
keyq <- rlang::enquo(key)
# break value vector into quotes
valueq <- rlang::enquo(value)
s <- rlang::quos(!!valueq)
df %>% gather(variable, value, !!!s) %>%
unite(temp, !!keyq, variable) %>%
spread(temp, value)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.