gpt4 book ai didi

r - 如何仅提供R Markdown 引用中的年份?

转载 作者:行者123 更新时间:2023-12-04 10:23:03 25 4
gpt4 key购买 nike

我的rmarkdown脚本如下所示:

---
title: "Untitled"
author: "me"
date: '`r format(Sys.time(), "%d %B, %Y")`'
output:
pdf_document: default
bibliography: bibliography.bib
---

In his book Helsel explains how to approach censored environmental data [@helsel_statistics_2012].

我的.bib文件如下:
@book{helsel_statistics_2012,
address = {Hoboken, N.J},
edition = {2nd ed},
series = {Wiley series in statistics in practice},
title = {Statistics for censored environmental data using {Minitab} and {R}},
isbn = {978-0-470-47988-9},
publisher = {Wiley},
author = {Helsel, Dennis R.},
year = {2012},
note = {00003 OCLC: ocn748290711},
keywords = {Environmental sciences, Measurement Statistical methods, Minitab, Pollution, R (Computer program language), Statistical methods},
}

编织文件时,将得到以下输出:

Helsel在他的书中解释了如何处理经过审查的环境数据(Helsel 2012)。

问题:如何仅在被引证的情况下返回年份(因为我已经在文本中说明了作者)?

在他的书Helsel (2012)中解释了如何处理受审查的环境数据。

最佳答案

在rmarkdown(.Rmd)文件中,添加以下内容(请注意,从[@ helsel_statistics_2012]中删除了[]方括号):

In his book @helsel_statistics_2012 explains how to approach censored environmental data.

渲染后,将为您提供所需的输出:
In his book Helsel (2012) explains how to approach censored environmental data.

如果您真的只想要引用的年份,那么:
[-@helsel_statistics_2012]

返回:
(2012)

有关更多详细信息,请参见关于 http://rmarkdown.rstudio.com/authoring_bibliographies_and_citations.html的rmarkdown文档。

关于r - 如何仅提供R Markdown 引用中的年份?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45757950/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com