.onAttach <- function(libname, pkg) {
pkg_ver <- paste0(pkg, " v", utils::packageDescription(pkg, fields="Version"))
citfile <- file.path(system.file(package = pkg), "CITATION")
cit <- format(readCitationFile(citfile), style="text")
packageStartupMessage(paste0(pkg_ver, "\n\nIf you use '", pkg, "' in published research, please cite:\n\n", cit))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.