如何引用R语言以及R包:文献引用

数据分析中经常使用R语言以及相关R包,写文章时就需要引用。这里介绍两种方法。

1. 默认的citeation函数

1.1 引用R语言

包括R版本和相关信息:

注意,函数中什么参数都不添加,会返回R语言的版本和相关信息。

citation()
> citation()

To cite R in publications use:

  R Core Team (2022). R: A language and environment for statistical
  computing. R Foundation for Statistical Computing, Vienna,
  Austria. URL https://www.R-project.org/.

LaTeX的用户的BibTeX条目是

  @Manual{,
    title = {R: A Language and Environment for Statistical Computing},
    author = {{R Core Team}},
    organization = {R Foundation for Statistical Computing},
    address = {Vienna, Austria},
    year = {2022},
    url = {https://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.

提取相关信息,就是:

R Core Team (2022). R: A language and environment for statistical
computing. R Foundation for Statistical Computing, Vienna,
Austria. URL https://www.R-project.org/.12c

1.2 引用具体R包

比如,这里想引用ggplot2

> citation("ggplot2")

To cite ggplot2 in publications, please use:

  H. Wickham. ggplot2: Elegant Graphics for Data Analysis.
  Springer-Verlag New York, 2016.

LaTeX的用户的BibTeX条目是

  @Book{,
    author = {Hadley Wickham},
    title = {ggplot2: Elegant Graphics for Data Analysis},
    publisher = {Springer-Verlag New York},
    year = {2016},
    isbn = {978-3-319-24277-4},
    url = {https://ggplot2.tidyverse.org},
  }

把里面的内容,提取出来,就是:

H. Wickham. ggplot2: Elegant Graphics for Data Analysis.
Springer-Verlag New York, 2016.

注意:如果R包没有在引号内,会报错:

> citation(ggplot2)
Error in system.file(package = package, lib.loc = lib.loc) : 
  object 'ggplot2' not found

2. 使用pacman更友好的形式

2.1 R语言引用

两种方法:

  • p_cite()
  • p_citation()
library(pacman)
p_citation()

2.2 R包引用

四种方法:

具体的R包,可以直接写名称,也可以用引号包裹:

方法1:p_cite("ggplot2")
方法2:p_cite(ggplot2)
方法3:p_citation(ggplot2)
方法4:p_citation("ggplot2")

p_cite和p_citation都可以用,包的名称加不加引号都可以用,更人性化一点。

p_cite(“ggplot2”)

To cite ggplot2 in publications, please use:

H. Wickham. ggplot2: Elegant Graphics for Data Analysis.
Springer-Verlag New York, 2016.

LaTeX的用户的BibTeX条目是

@Book{,
author = {Hadley Wickham},
title = {ggplot2: Elegant Graphics for Data Analysis},
publisher = {Springer-Verlag New York},
year = {2016},
isbn = {978-3-319-24277-4},
url = {https://ggplot2.tidyverse.org},
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值