cleanOption <- function(){
empty <- character(0)
class(empty) <- "bibentry"
useEnv <- which(search() %in% "knitcitationVars")
assign("works.cited", empty, pos=useEnv)
print("cleanedUp!")
}
callAddOption <- function(inputString){
tmpDat <- addOption(inputString)
I(tmpDat)
}
addOption <- function(inputString){
useEnv <- which(search() %in% "knitcitationVars")
if (!(exists("works.cited", where=useEnv))){
cleanOption()
}
class(inputString) <- "bibentry"
oldOption <- get("works.cited", pos=useEnv)
newOption <- c(oldOption, inputString)
assign("works.cited", newOption, pos=useEnv)
newOption
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.