[R-pkg-devel] LICENSE file in an R package for CRAN submission
On Wed, Aug 16, 2023 at 11:41?AM Vincent Goulet <vincent.goulet at me.com> wrote:
Although late to the party, I thought I might chime in with a different take on the question. Most answers seem to pertain to the actual license used for the package. For my part, I read the question as: "GitHub wants me to have a LICENSE file at the root of the repository, but R CMD check complains about it. What should I do?" If you need to use the LICENSE file in your package, Ben Bolker already pointed you at the correct way to do it. If the file is just there to please GitHub (and in any case), here's what I tend to do: put the source code of your package in a subdirectory (say 'src') of the repository. You may then put the GitHub files (README.md, LICENSE, whatever else) at the top level without interfering with R CMD build/check. The added benefit is that you will then build the package in the directory of the project (say 'mypkg') with 'R CMD build src' and end up with a file .../mypkg/mypkg_x.y-z.tar.gz, rather than in the parent directory of 'mypkg'.
Another alternative is put everything you don't want to be included in your package in the .Rbuildignore file. For example: https://github.com/joshuaulrich/xts/blob/main/.Rbuildignore
(Mind you, I build my packages manually. The tidyverse tools may very well take care of this sort of things automatically and I wouldn't know.)
I also build my packages manually (with a makefile) and have my own personal preferences, so the patterns in my file may need to be changed for others' packages.
Hope this helps, v. Vincent Goulet Professeur titulaire ?cole d'actuariat, Universit? Laval
Le 9 ao?t 2023 ? 11:06, Emanuele Cordano <emanuele.cordano at gmail.com> a ?crit : Dear list, is there a way to put the LICENSE file within an R package like in Github, I have an R package on Github with a a LICENSE file compliant to Github and containing the text of the licence citing in the DESCRIPION file. But when I check the package , I obatained the following output: * checking top-level files ... NOTE File LICENSE is not mentioned in the DESCRIPTION file. How can I solve this? Thank you best Emanuele Cordano -- Emanuele Cordano, PhD Environmental Engineer / Ingegnere per l' Ambiente e il territorio nr. 3587 (Albo A - Provincia di Trento) cell: +39 3282818564 email: emanuele.cordano at gmail.com,emanuele.cordano at rendena100.eu, emanuele.cordano at eurac.edu PEC: emanuele.cordano at ingpec.eu URL: www.rendena100.eu LinkedIn: https://www.linkedin.com/in/emanuele-cordano-31995333 GitHub: https://github.com/ecor [[alternative HTML version deleted]]
______________________________________________ R-package-devel at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
______________________________________________ R-package-devel at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
-- Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com