vignettes/embed_jpg_in_html.R

# This is no longer used but is retained in case it is needed in the future.
embed_jpg_in_html <- function(htmlfile, jpgfile, overwrite = FALSE) {
  htmlorig <- readLines(htmlfile)
  htmlupdated <- if(overwrite) htmlfile else gsub(".html", "_modified.html", htmlfile)
  txtfile <- gsub(".jpg", ".txt", jpgfile)
  system2("base64", c("-i", jpgfile, "-o", txtfile))
  binarytxt <- readLines(txtfile)
  htmlmodified <- gsub(jpgfile, paste0("data:image/jpg;base64,", binarytxt), htmlorig)
  writeLines(htmlmodified, con = htmlupdated)
}

Try the compareMCMCs package in your browser

Any scripts or data that you put into this service are public.

compareMCMCs documentation built on Oct. 7, 2024, 1:25 a.m.