Reputation: 567
The CRAN policies (https://cran.r-project.org/web/packages/policies.html) for R package development require:
"Packages should not write in the user’s home filespace (including clipboards), nor anywhere else on the file system apart from the R session’s temporary directory (or during installation in the location pointed to by TMPDIR: and such usage should be cleaned up)."
If a file is created in the R session's temporary directory, does it then need to be cleaned up? Or does it only apply "during installation in the location pointed to by TMPDIR". I am unsure, given the "and such usage should be cleaned up" is contained within the brackets, whether it applies to creating files in the temporary directory during function examples.
For example, the following command will create an SQLite database in the R session's temporary directory:
testdb <- RSQLite::dbConnect(RSQLite::SQLite(), tempfile("temp"))
Would the file in the temporary directory have to be removed after running an example of a function which uses this command?
Part of my confusion comes from not understanding what TMPDIR is during installation.
Upvotes: 1
Views: 37