R“stats”引用科学论文

时间:2013-03-28 17:50:06

标签: r package stat citations

我使用R包'stats'(版本2.15.3)分析了我的数据。一位评论员问我这个包的正确引用,而不仅仅是常见的

R核心团队(2012年)。 R:统计计算的语言和环境。 R统计计算基金会,奥地利维也纳。 ISBN 3-900051-07-0,URL http://www.R-project.org/

任何人都知道在哪里可以找到有效的引文插入我的论文? 感谢

5 个答案:

答案 0 :(得分:66)

评论员错了:

 citation("stats")

The ‘stats’ package is part of R.  To cite R in publications use:

  R Core Team (2013). R: A language and environment for statistical computing. R
  Foundation for Statistical Computing, Vienna, Austria. ISBN 3-900051-07-0, URL
  http://www.R-project.org/.

A BibTeX entry for LaTeX users is

  @Manual{,
    title = {R: A Language and Environment for Statistical Computing},
    author = {{R Core Team}},
    organization = {R Foundation for Statistical Computing},
    address = {Vienna, Austria},
    year = {2013},
    note = {{ISBN} 3-900051-07-0},
    url = {http://www.R-project.org/},
  }

We have invested a lot of time and effort in creating R, please cite it when
using it for data analysis. See also ‘citation("pkgname")’ for citing R
packages.

答案 1 :(得分:12)

在我们最近的book中,我的合着者和我做了R引用(在前线),但也让出版商让我们也给予每包信用:

enter image description here

我们认为重要的是要确保那些完成工作的人一直得到信誉。

(我只是做了这个评论,但是不能轻易地嵌入pix,并且不想在某个地方主持img。)

答案 2 :(得分:12)

正如hrbrmstr指出的那样,创建仅加载的包的引用列表的函数会派上用场。因为他只向我们展示了一个例子而不是函数,我自己写了一篇,我经常在科学分析和论文中使用它(有时与R Markdown相结合)。

citations <- function(includeURL = TRUE, includeRStudio = TRUE) {
    if(includeRStudio == TRUE) {
        ref.rstudio <- RStudio.Version()$citation
        if(includeURL == FALSE) {
            ref.rstudio$url = NULL;
        }
        print(ref.rstudio, style = 'text')
        cat('\n')
    }

    cit.list <- c('base', names(sessionInfo()$otherPkgs))
    for(i in 1:length(cit.list)) {
        ref <- citation(cit.list[i])
        if(includeURL == FALSE) {
            ref$url = NULL;
        }
        print(ref, style = 'text')
        cat('\n')
    }
}

因此,例如,在运行

之后
library(readr)
library(dplyr)
library(ggplot2)
library(knitr)

功能 citations() 将打印:

RStudio团队(2016年)。 RStudio:R 的集成开发环境。 RStudio,Inc.,Boston,MA。 http://www.rstudio.com

R核心团队(2017年)。 R:统计计算的语言和环境。 R统计基金会 计算,维也纳,奥地利。 https://www.R-project.org

谢(2016)。 knitr:R 中动态报告生成的通用软件包。 R包版本1.15.1,http://yihui.name/knitr

谢谢(2015)。 带R和knitr的动态文档,第2版。查普曼和霍尔/ CRC,佛罗里达州博卡拉顿。 ISBN 978-1498716963,http://yihui.name/knitr

谢叶(2014)。 “knitr:R中可重复研究的综合工具”,Stodden V,Leisch F和Peng RD (编辑),实施可重复的计算研究。查普曼和霍尔/ CRC。 ISBN 978-1466561595, http://www.crcpress.com/product/isbn/9781466561595

Wickham H(2009)。 ggplot2:用于数据分析的优雅图形。 Springer-Verlag纽约。国际标准书号 978-0-387-98140-6,http://ggplot2.org

Wickham H和Francois R(2016)。 dplyr:数据处理的语法。 R包版本0.5.0,https://CRAN.R-project.org/package=dplyr

Wickham H,Hester J和Francois R(2016)。 readr:读取表格数据。 R包版本1.0.0,https://CRAN.R-project.org/package=readr

答案 3 :(得分:4)

现在有一个grateful包可以很方便:

  

感激的目标是让R包很容易引用   用于任何报告或出版物。通过调用单个函数,它   将扫描项目中使用的R包并生成一个文档   所需输出格式的引文(Word,PDF,HTML,Markdown)。   重要的是,这些引用可以针对特定日志进行格式化   这样我们就可以直接将它们粘贴到参考书目列表中   我们的手稿或报告。

https://github.com/Pakillo/grateful

如果加载了包stats,则可以通过运行以下来获取引用:

library(grateful)
cite_packages()

- 已经通过运行安装grateful来安装:

library(devtools)
install_github("Pakillo/grateful")

答案 4 :(得分:0)

我喜欢 MS Berends 的解决方案,但想要一个版本号如 this answer 的表。我还想摆脱 format(citation(pkg), style = 'text') 生成的 Markdown,这样我就可以轻松地复制粘贴到 MS Word 中。

require(pacman)
require(gt)
require(stringr)
require(dplyr)
get_package_citation_table <- function(){
  appendix_packages <- data.frame(Package = character(),
                                  Version = character(),
                                  Maintainer = character(),
                                  Citation = character())
  
  for (pkg in p_loaded()){
    appendix_packages <- appendix_packages %>% add_row(
      Package = pkg,
      Version = as.character(packageVersion(pkg)),
      Maintainer = maintainer(pkg),
      Citation = format(citation(pkg), style = 'text')
    )
  }
  appendix_packages <- appendix_packages %>% 
    add_row(
      Package = "RStudio",
      Version = as.character(RStudio.Version()$version),
      Maintainer = "",
      Citation = format(RStudio.Version()$citation, style = "text") 
    ) %>%
    add_row(
      Package = "R",
      Version = paste(version$major,version$minor, sep="."),
      Maintainer = "",
      Citation = format(citation(), style = "text")
    )
  
  appendix_packages %>%
    mutate( Citation = Citation %>% # strip out the markdown
              str_replace_all("_","") %>%
              str_replace_all("[*]", "") %>%
              str_replace_all("<URL:", "") %>%
              str_replace_all(">","")) %>% 
    arrange(Package)
  
}

t<- get_package_citation_table() 
t %>% gt()
相关问题