I am writing an R package and build and test it with:
Rscript -e "devtools::document()" && R CMD build . && Rscript -e "devtools::test();devtools::check()"
I get a note:
checking top-level files
Non-standard file/directory found at top level:
‘PosteriorBootstrap_0.0.1.tar.gz’
I get the note whether devtools::check()
comes first or second.
This thread suggests:
The note is telling you that you usually shouldn't have a file called build in the top level of your package.
The tar.gz
file is created by R CMD build
and I get the same error even if I delete it before running it.
This
thread
suggests adding the tar.gz
file to .Rbuildinore
, which removes the note.
Another way to remove it is to run everything from devtools:
Rscript -e "devtools::document(); devtools::build(); devtools::load_all('.'); devtools::test(); devtools::check()"
And then I don't get that note.
What's the difference between R CMD build
and devtools::build()
and why does the former throw that note?