Package's annual maintenance

I released my first package in 2023. Now that we've kicked off 2024, I'm wondering if there is any information that needs to be updated when entering a new year.

E.g., should I update the year in the CITATION file?

I don't remember reading anything about it in the R Packages (2e) book.

1 Like

If you're still actively developing the package, then yes you should bump the year in the license file if you have them. For example, if you are using the typical setup for the MIT license, you should bump the year in LICENSE and LICENSE.md.

E.g., should I update the year in the CITATION file?

Do you have a custom citation file for your package? In that case you are probably citing a publication, and you should leave the year as the date of the publication.

If you don't have a citation file, then you don't need to do anything. The function citation() automatically pulls the date from the field Date/Publication in DESCRIPTION (this field is automatically added when you install the package).

Now what I don't know is whether it is better to use a date range (eg 2023-2024) or just the current year (2024) when asserting your copyright. As with most legal advice around software I find on the internet, when I searched for the answer, I found tons of conflicting advice. If anyone has an authoritative source, I'd love to read it.

1 Like

Alright, thanks for your input! That's exactly what I was looking for.

I'm using a GPL-3 license so nothing to change there.

As for the citation, my package uses the default citation (generated from the DESCRIPTION file). I'll then bump the year to 2024 for the next release. I think using the current year makes more sense for the citation since we usually want to cite the package version used at a given time, which can only be linked to a single year.

Glad my post was helpful!

I don't understand why you are manually including inst/CITATION if you aren't customizing beyond the default. I think this is unnecessary. I recommend you delete this file and rely on the default behavior. When you submit your package to CRAN, it will automatically insert the year into the field Date/Publication. Does the pkgdown citation page not include the year without manually creating a citation file?

1 Like

You're right. Now that I check again, I see that dplyr and other tidyverse packages rely on the DESCRIPTION file to build the citation.

I created the citation file using usethis::use_citation() because I was following the recommendations in the 'Package citation' section of the R package (2e) book a bit too closely but this is unnecessary in my case. I'll delete that file and rely on the default behavior.

Thanks again!

1 Like

Great! Glad I could convince you :slight_smile:

I confirmed that pkgdown will properly include the year in the citation page (even though the local package doesn't include the Date/Publication field). The only downside I could find was that if someone installs your package directly from GitHub, then the citation won't include the year. This is an edge case, so I don't think it is worth supporting by manually maintaining a CITATION file (especially since it is easy to forget to update; no year is better than the wrong year). (2024-02-22: I was mistaken. install_github() inserts the fields Packaged and Built into DESCRIPTION, so even users that install the development version directly from GitHub will see the year in CITATION, though it would be the current year, and not the year you last published to CRAN)

file.remove("inst/CITATION")
devtools::load_all()
citation("plume")
## To cite package ‘plume’ in publications use:
##   
##   Gallou A (????). _plume: A Simple Author Handler for Scientific Writing_. R package
## version 0.2.3.9000, https://github.com/arnaudgallou/plume,
## <https://arnaudgallou.github.io/plume/>.
## 
## A BibTeX entry for LaTeX users is
## 
## @Manual{,
##   title = {plume: A Simple Author Handler for Scientific Writing},
##   author = {Arnaud Gallou},
##   note = {R package version 0.2.3.9000, 
##     https://github.com/arnaudgallou/plume},
##   url = {https://arnaudgallou.github.io/plume/},
## }
## Warning message:
##   In citation("plume") :
##   could not determine year for ‘plume’ from package DESCRIPTION file

I wanted to note that your package is very well organized and structured. Keep up the good work!

1 Like

I removed the CITATION file but for some reasons I'm getting a different output:

file.exists("inst/CITATION")
#> [1] FALSE

devtools::load_all()
citation("plume")
#> Warning in citation("plume"): no date field in DESCRIPTION file of package
#> 'plume'
#> Warning in citation("plume"): could not determine year for 'plume' from package
#> DESCRIPTION file
#> 
#> To cite package 'plume' in publications use:
#> 
#>   Gallou A (????). _plume: A Simple Author Handler for Scientific
#>   Writing_. https://arnaudgallou.github.io/plume/,
#>   https://github.com/arnaudgallou/plume.
#> 
#> A BibTeX entry for LaTeX users is
#> 
#>   @Manual{,
#>     title = {plume: A Simple Author Handler for Scientific Writing},
#>     author = {Arnaud Gallou},
#>     note = {https://arnaudgallou.github.io/plume/,
#> https://github.com/arnaudgallou/plume},
#>   }

Also, it seems like citing dplyr (which generates the citation from the DESCRIPTION file) shows the year properly.

citation("dplyr")
#> 
#> To cite package 'dplyr' in publications use:
#> 
#>   Wickham H, François R, Henry L, Müller K, Vaughan D (2023). _dplyr: A
#>   Grammar of Data Manipulation_. R package version 1.1.1,
#>   <https://CRAN.R-project.org/package=dplyr>.
#> 
#> A BibTeX entry for LaTeX users is
#> 
#>   @Manual{,
#>     title = {dplyr: A Grammar of Data Manipulation},
#>     author = {Hadley Wickham and Romain François and Lionel Henry and Kirill Müller and Davis Vaughan},
#>     year = {2023},
#>     note = {R package version 1.1.1},
#>     url = {https://CRAN.R-project.org/package=dplyr},
#>   }

Both DESCRIPTION files contain the same basic information.

Any idea why I'm getting a different bib entry?

Building the pkgdown site locally shows the year though.

I'm not sure why your output is slightly different. It is mostly the same just rearranged. The only substantial difference I see is that your output doesn't include the package version. I am using R 4.3.2 on Windows. Maybe the R version is causing the difference?

That's because you installed {dplyr} from CRAN, which inserts the field Date/Publication. Note also that I was mistaken above. If a user installs the development version of your package directly from GitHub, install_github() still inserts the year into DESCRIPTION (albeit in a slightly different field name). Only with devtools::load_all() do you get the warning about the missing year, so this is nothing to worry about, since only package developers (ie you) will see it.

# dplyr from CRAN
citation("dplyr")
## To cite package ‘dplyr’ in publications use:
##   
##   Wickham H, François R, Henry L, Müller K, Vaughan D (2023). _dplyr: A Grammar of Data
## Manipulation_. R package version 1.1.4, <https://CRAN.R-project.org/package=dplyr>.
## 
## A BibTeX entry for LaTeX users is
## 
## @Manual{,
##   title = {dplyr: A Grammar of Data Manipulation},
##   author = {Hadley Wickham and Romain François and Lionel Henry and Kirill Müller and Davis Vaughan},
##   year = {2023},
##   note = {R package version 1.1.4},
##   url = {https://CRAN.R-project.org/package=dplyr},
## }

# dplyr from install_github()
remotes::install_github("tidyverse/dplyr")
citation("dplyr")
## To cite package ‘dplyr’ in publications use:
##   
##   Wickham H, François R, Henry L, Müller K, Vaughan D (2024). _dplyr: A Grammar of Data
## Manipulation_. R package version 1.1.4.9000, https://github.com/tidyverse/dplyr,
## <https://dplyr.tidyverse.org>.
## 
## A BibTeX entry for LaTeX users is
## 
## @Manual{,
##   title = {dplyr: A Grammar of Data Manipulation},
##   author = {Hadley Wickham and Romain François and Lionel Henry and Kirill Müller and Davis Vaughan},
##   year = {2024},
##   note = {R package version 1.1.4.9000, https://github.com/tidyverse/dplyr},
##   url = {https://dplyr.tidyverse.org},
## }

# dplyr from load_all()
devtools::load_all()
citation("dplyr")
## To cite package ‘dplyr’ in publications use:
##   
##   Wickham H, François R, Henry L, Müller K, Vaughan D (????). _dplyr: A Grammar of Data
## Manipulation_. R package version 1.1.4.9000, https://github.com/tidyverse/dplyr,
## <https://dplyr.tidyverse.org>.
## 
## A BibTeX entry for LaTeX users is
## 
## @Manual{,
##   title = {dplyr: A Grammar of Data Manipulation},
##   author = {Hadley Wickham and Romain François and Lionel Henry and Kirill Müller and Davis Vaughan},
##   note = {R package version 1.1.4.9000, https://github.com/tidyverse/dplyr},
##   url = {https://dplyr.tidyverse.org},
## }
## Warning message:
##   In citation("dplyr") :
##   could not determine year for ‘dplyr’ from package DESCRIPTION file

install_github() inserts the fields Packaged and Built (not sure which one is used by citation())

grep 2024 ~/AppData/Local/R/win-library/4.3/dplyr/DESCRIPTION
## Packaged: 2024-02-22 16:02:11 UTC; john
## Built: R 4.3.2; x86_64-w64-mingw32; 2024-02-22 16:02:19 UTC; windows

That was it! I was using R 4.2.0. I'm now getting the same output as you.

Ah yes, I read your 2nd post too fast but that makes sense.

Thanks again for your help, that's really appreciated!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.