# loadRecent() - updated
loadRecent <- function(path,fileString,type){
files <- data.frame(files=list.files(path),stringsAsFactors=F)
files$Time <- sapply(files$files, function(x){
file.info(file.path(path,x))$mtime
})
files <- files[order(files$Time,decreasing=T),]
files <- files[grep(fileString,files$files),"files"][1]
message(paste0("Loading the file: ",files))
if (toupper(type)=="RDS") {
return(readRDS(file.path(path,files)))
} else {
return(load(file.path(path,files),envir=.GlobalEnv))
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.