From 09dffc68cfad1b4d755e12c07bd85e30f3a08410 Mon Sep 17 00:00:00 2001 From: Francisco Rodriguez-Sanchez Date: Fri, 27 Sep 2024 11:16:45 +0200 Subject: [PATCH] update FAQ [skip ci] --- README.Rmd | 22 +++++++++++++++++++++- README.md | 29 ++++++++++++++++++++++++++--- 2 files changed, 47 insertions(+), 4 deletions(-) diff --git a/README.Rmd b/README.Rmd index 2f50027..7aabd49 100644 --- a/README.Rmd +++ b/README.Rmd @@ -241,7 +241,27 @@ Apart from citing the software most relevant to the particular research/analysis ### Some packages include several citations -Some packages include more than one citation (e.g. [knitr](https://cran.r-project.org/web/packages/knitr/citation.html), [mgcv](https://cran.r-project.org/web/packages/mgcv/citation.html)). `grateful` will include all those citations by default, as it is impossible to decide automatically which citations should be included in each case. The user may manually remove citations from the produced reference list after calling `cite_packages`. If using Quarto or Rmarkdown, the unwanted references can be deleted from `grateful-refs.bib` so they will not appear cited. +Some packages include more than one citation (e.g. [knitr](https://cran.r-project.org/web/packages/knitr/citation.html), [mgcv](https://cran.r-project.org/web/packages/mgcv/citation.html)). `grateful` will include all those citations by default, as it is impossible to decide automatically which citations should be included in each case. The user may manually remove citations from the produced reference list after calling `cite_packages`. If using Quarto or Rmarkdown, we can generate the citation paragraph and manually remove the unwanted references so they will not appear cited. + +For example, `mgcv` package provides multiple references to be cited: + +```{r} +citation("mgcv") +``` + +To choose just one of them to be cited, we could generate a citation paragraph using `cite_packages` + +```{r eval=FALSE} +cite_packages("paragraph", out.dir = ".") +``` + +![](man/figures/paragraph.png) + +And then manually remove the unwanted citation keys, leaving just those we want to cite: + +![](man/figures/paragraph_edited.png) + +When rendering the Rmarkdown or Quarto document, only the chosen references will be cited. ### Removing unused packages diff --git a/README.md b/README.md index a580015..ec15c1f 100644 --- a/README.md +++ b/README.md @@ -182,7 +182,7 @@ scan_packages() 1 badger 0.2.4 2 base 4.4.1 3 knitr 1.48 -4 pkgdown 2.1.0 +4 pkgdown 2.1.1 5 remotes 2.5.0 6 renv 1.0.7 7 rmarkdown 2.28 @@ -312,8 +312,31 @@ Some packages include more than one citation impossible to decide automatically which citations should be included in each case. The user may manually remove citations from the produced reference list after calling `cite_packages`. If using Quarto or -Rmarkdown, the unwanted references can be deleted from -`grateful-refs.bib` so they will not appear cited. +Rmarkdown, we can generate the citation paragraph and manually remove +the unwanted references so they will not appear cited. + +For example, `mgcv` package provides multiple references to be cited: + +``` r +citation("mgcv") +``` + +To choose just one of them to be cited, we could generate a citation +paragraph using `cite_packages` + +``` r +cite_packages("paragraph", out.dir = ".") +``` + +![](man/figures/paragraph.png) + +And then manually remove the unwanted citation keys, leaving just those +we want to cite: + +![](man/figures/paragraph_edited.png) + +When rendering the Rmarkdown or Quarto document, only the chosen +references will be cited. ### Removing unused packages