文章目录
数据分析中经常使用R语言以及相关R包,写文章时就需要引用。这里介绍两种方法。
1. 默认的citeation函数
1.1 引用R语言
包括R版本和相关信息:
注意,函数中什么参数都不添加,会返回R语言的版本和相关信息。
提取相关信息,就是:
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:
把里面的内容,提取出来,就是:
H. Wickham. ggplot2: Elegant Graphics for Data Analysis.
Springer-Verlag New York, 2016.
注意:如果R包没有在引号内,会报错:
2. 使用pacman更友好的形式
2.1 R语言引用
两种方法:
- p_cite()
- 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},
}
















