Skip to content

Commit

Permalink
update FAQ [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
Pakillo committed Sep 27, 2024
1 parent f28b020 commit 09dffc6
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 4 deletions.
22 changes: 21 additions & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
29 changes: 26 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 09dffc6

Please sign in to comment.