copy.into.missing.fields = function(dest, source) {
restore.point("copy.into.empty.fields")
new.fields = setdiff(names(source), names(dest))
dest[new.fields] = source[new.fields]
dest
}
colored.html = function(txt, color="blue") {
if (is.null(color)) return(txt)
paste0("<font color='",color,"'>",txt,"</font>")
}
# mark the encoding of character vectors as UTF-8
mark_utf8 <- function(x) {
if (is.character(x)) {
Encoding(x) <- 'UTF-8'
return(x)
}
if (!is.list(x)) return(x)
attrs <- attributes(x)
res <- lapply(x, mark_utf8)
attributes(res) <- attrs
res
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.