How do I determine the author of an R package?

后端 未结 4 1453
迷失自我
迷失自我 2021-02-19 03:58

How can I determine who the authors of a package are? Given that we have this widely used code base, I think it is appropriate that I make a reference to the software I use in m

4条回答
  •  你的背包
    2021-02-19 04:25

    Some cleaning needed, but you get the idea. :)

    library(RCurl)
    gg <- getURL("http://cran.r-project.org/web/packages/ggdendro/index.html")
    gg <- readLines(textConnection(gg))
    gg[grep("Author:", gg)+1]
     [1] "Andrie de Vries"
    

    Richie beat me to it, but here's a short way of extracting some information using citation.

    citation("ggdendro")$author
    [1] "Andrie de Vries "
    

    In comments, Hadley suggested another method of reading straight from the DESCRIPTION file.

    > gg <- read.dcf(url("http://cran.r-project.org/web/packages/ggdendro/DESCRIPTION"))
    > gg[, "Maintainer"]
                               Maintainer 
    "Andrie de Vries "
    

提交回复
热议问题