tidyTitle = function(title){
if(any(is.na(title))){
title[is.na(title)] = ""
}
proper = function(x){
gsub("(*UCP)\\b(\\p{L})", "\\U\\1", x, perl = TRUE)
}
correctCapitals = function(x){
allowed = "(PLS|LSMM|ALTREP|NZ|GARCH|DNA|II|EWMA|R&D|P\\(X<Y\\)|gridSVG|von[-]?Mises|ARMA|SPSS|SVM|BIG-SIR|SSREM|GWAS|IGESS|LSSM|BIVAS)"
x = gsub(allowed, "\\U\\1", x, ignore.case = TRUE, perl = TRUE)
x = gsub("GRIDSVG", "gridSVG", x)
x = gsub("VON-MISES", "von Mises", x)
x = gsub("&", "&", x)
x = gsub("<", "<", x)
x = gsub("[’']S", "'s", x)
x = gsub("&Hellip;", "…", x)
x = gsub("ARt", "aRt", x)
return(x)
}
title = title %>%
proper() %>%
correctCapitals()
return(title)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.