This document is testing methods for posting both the HTML and the RMD documents on RPubs.
It’s based on the software posted here.
attachFile <- function(file){
myrmd = base64enc::dataURI(file = file, mime = 'text/rmd')
dl_link = paste0("<a href='%s' target='_blank' download='",
basename(file),"'> ⇒ ",file,"</a> ")
cat(sprintf(dl_link, myrmd))
}
attachFiles <- function( ... ) {
files <- unlist(list(...)) # arguments to a vector of strings
cat("#### Attached files\n\n")
for(F in files) {
attachFile(F)
cat("\n")
}
}
Now to try it.
⇒ TestHandingIn.Rmd
⇒ XLSXfile.xlsx
This is the one I want to use … multiple files: