Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Cite R 📦 on the fly in R Markdown and Quarto

License

NotificationsYou must be signed in to change notification settings

arnaudgallou/pakret

Repository files navigation

Lifecycle: stableCRAN statusR-CMD-check

Overview

pakret is a minimalist R package citation tool to reference and cite Rand R packages on the fly in R Markdown and Quarto.

Installation

Install pakret from CRAN with:

install.packages("pakret")

Alternatively, you can install the development version of pakret fromGitHub with:

# install.packages("pak")pak::pak("arnaudgallou/pakret")

Usage

Simply usepkrt() whenever you want to cite R or an R package in yourdocument:

---bibliography: references.bib---```{r}#| include: falselibrary(pakret)```We used `r pkrt("foo")` to extract the data.Analyses were performed using `r pkrt("bar")`.## References

pakret handles everything for you.

Here’s the markdown output produced by the document above:

We used the ‘foo’ package version 1.0.0 (Fastandfurius, Clausus, andLastopus 2020) to extract the data.Analyses were performed using the ‘bar’ package version 0.2.0(Itisalapsus 2024).## ReferencesFastandfurius, Caius, Numerius Clausus, and Marcus Lastopus. 2020.*<span>foo</span>: Alea Jacta Est*.Itisalapsus, Julius. 2024. *<span>bar</span>: Tempus EdaxRerum*.

You can also cite a collection of packages withpkrt_list():

---bibliography: references.bib---```{r}#| include: falselibrary(pakret)```I used the following packages: `r pkrt_list("foo", "bar")`.## References
I used the following packages: ‘foo’ v. 1.0.0 (Fastandfurius, Clausus,and Lastopus 2020), ‘bar’ v. 0.2.0 (Itisalapsus 2024).## ReferencesFastandfurius, Caius, Numerius Clausus, and Marcus Lastopus. 2020.*<span>foo</span>: Alea Jacta Est*.Itisalapsus, Julius. 2024. *<span>bar</span>: Tempus EdaxRerum*.

Unhappy with the default templates? pakret lets you define your own:

---bibliography: references.bib---```{r}#| include: falselibrary(pakret)pkrt_set(pkg = "the R package *:pkg* [v. :ver, :ref]")```We used `r pkrt("foo")` to analyse the data.## References
We used the R package *foo* (v. 1.0.0, Fastandfurius, Clausus, andLastopus 2020) to analyse the data.## ReferencesFastandfurius, Caius, Numerius Clausus, and Marcus Lastopus. 2020.*<span>foo</span>: Alea Jacta Est*.

Note that by default pakret writes new references into the first.bibfile specified in the bibliography list. You can change which.bibfile to save references to usingpkrt_set().

About

Cite R 📦 on the fly in R Markdown and Quarto

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp