## the basic R reference
citation()
## references for a package -- might not have these installed
if(nchar(system.file(package = "lattice"))) citation("lattice")
if(nchar(system.file(package = "foreign"))) citation("foreign")
## extract the bibtex entry from the return value
x <- citation()
toBibtex(x)
## A citation with more than one bibentry:
cm <- tryCatch(citation("mgcv"),
error = function(e) {
warning("Recommended package 'mgcv' is not installed properly")
stop(e$message) })
cm # short entries (2-3 lines each)
print(cm, bibtex = TRUE) # each showing its bibtex code
<!-- %dont -->
Run the code above in your browser using DataLab