Skip to content
Prev 5326 / 12125 Next

[R-pkg-devel] Detritus in temp directory - Note from submission of R package in CRAN

On 18/04/2020 5:55 p.m., Jeff Newmiller wrote:
I think your advice would probably pass the checks, but it's bad advice, 
because it leaves the user vulnerable to having files wiped out by 
myfunc().

Functions shouldn't write to the current directory unless the user 
explicitly asks for it.

A better header would be

myfunc <- function( x, y, ..., path_pet = temp.dir(), path_p = 
temp.dir() ) {

Then the user has to explicitly code "path_pet = getwd()" to wipe out 
their own files.

Duncan Murdoch