columnsToNamedVector = function(df) {
if(ncol(df) == 2) {
return(setNames(as.character(df[,1] %>% pull()), df[,2] %>% pull()))
} else {
stop("Only two-columns data frames are allowed")
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.