Is it possible to add an option when building/checking a package to automatically update the Date field in the description file? An outdated Date fields seems to be a common mistake in the submission of packages to CRAN (I know I forget to do so often); adding this option would probably go a long way in reducing that error.
The Date field is not needed, you can just remove it completely. CRAN will add their own Date/Publication field to the package they put in the repository.
I was not aware of that, thanks for the tip!
I agree. It would be nice for the Date to be automatically loaded into the DESCRIPTION file by default. That way (for example) citation("tidyr") won't throw the warning message that
Warning messages:
1: In citation("tidyr") :
no date field in DESCRIPTION file of package ‘tidyr’
2: In citation("tidyr") :
could not determine year for ‘tidyr’ from package DESCRIPTION file
The current citation for the tidyr package lists the date as NA
Hadley Wickham (NA). tidyr: Easily Tidy Data with
`spread()` and `gather()` Functions. R package
version 0.6.0.9000. https://github.com/hadley/tidyr
This will most likely generate nagging comments from journal reviewers when citing R packages in manuscripts/publications.
@melindahiggins2000 That behavior will only happen when installing the package with install_github(), if downloaded from CRAN the package will have a Date/Publication field that is used.
citation("tidyr")
#>
#> To cite package 'tidyr' in publications use:
#>
#> Hadley Wickham (2016). tidyr: Easily Tidy Data with `spread()`
#> and `gather()` Functions. R package version 0.6.0.
#> https://CRAN.R-project.org/package=tidyr
#>
#> A BibTeX entry for LaTeX users is
#>
#> @Manual{,
#> title = {tidyr: Easily Tidy Data with `spread()` and `gather()` Functions},
#> author = {Hadley Wickham},
#> year = {2016},
#> note = {R package version 0.6.0},
#> url = {https://CRAN.R-project.org/package=tidyr},
#> }
we could add this same field to the package description when we install it from GitHub, which would fix the behavior you describe.
Ahh good point - I see now the difference in the CRAN vs development Github versions. I just think in general it is good practice to track the date of the current version in use and when cited. Thank you for the clarification.
@jimhester If I'm understanding correctly, this is not implemented yet
we could add this same field to the package description when we install it from GitHub
I think that can actually be very helpful, not just for citation usage.
install_github now, and lots of users just use the github version instead of CRAN version.Adding to what has been mentioned above, I believe it would be useful for the date field to be updated automatically (specifically, for use with citation) because it is often the case that one needs to cite a package that is only on github, i.e., not on cran.
Why build date, rather than timestamp of the commit from which it was built? I'd compared that with the publication date of an article vs. the timestamp of the publisher-generated PDF that I download.
Also: can the version be mapped back to a git commit in each case? When using the GitHub-Zenodo integration and being stringent about release tagging, it always can be, can't it?
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/
Most helpful comment
@jimhester If I'm understanding correctly, this is not implemented yet
I think that can actually be very helpful, not just for
citationusage.install_githubnow, and lots of users just use the github version instead of CRAN version.