Hello,

The CRAN policies (https://cran.r-project.org/web/packages/policies.html) for R 
package development state:

"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/vignettes/tests.

For example, the following command will create an SQLite database in the R 
session's temporary directory:

testdb <- RSQLite::dbConnect(RSQLite::SQLite(), tempfile("temp"))

Suppose a package function (called: myfunc) runs this command. Should the file 
created in the temporary directory have to be removed after running an example 
of myfunc, or a test for myfunc, or when myfunc is used in a vignette?

I think part of my confusion comes from not understanding what TMPDIR is during 
installation. Is this just the temporary directory used when vignettes are 
built during package installation? In which case they are effectively the same 
thing?

Many thanks


        [[alternative HTML version deleted]]

______________________________________________
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

Reply via email to