R/citations.R

Defines functions toBibtex.HSAURcitation HSAURcite

HSAURcite <- function(pkg) {
    ct <- citation(pkg)
    attr(ct, "label") <- paste("PKG:", pkg, sep = "", collapse = "")
    for (n in c("note"))
        ct[[n]] <- gsub("R", "\\R{}", ct[[n]])
    class(ct) <- "HSAURcitation"
    return(ct)
}

toBibtex.HSAURcitation <-  function (object, ...) 
{
    z <- paste("@", attr(object, "entry"), "{", attr(object, "label"), 
               ",", sep = "")
    if ("author" %in% names(object)) {
        object$author <- toBibtex(object$author)
    }
    for (n in names(object)) z <- c(z, paste("  ", n, " = {", 
        object[[n]], "},", sep = ""))
    z <- c(z, "}")
    class(z) <- "Bibtex"
    z
}

Try the HSAUR package in your browser

Any scripts or data that you put into this service are public.

HSAUR documentation built on Aug. 19, 2017, 1:03 a.m.