Skip to content
Prev 4470 / 12125 Next

[R-pkg-devel] Passing CRAN check when an examples must save a file

On 26/09/2019 11:43 p.m., Zachary Flynn wrote:
Save the file to the temporary directory, ?.g.

   filename <- file.path(tempdir(), "Prod?c.csv")
   write.csv(something, file = filename)

You could clean up at the end of the example with

   unlink(filename)

but you shouldn't rely on this alone to prevent the error:  if you're 
writing files, you should *only* be doing it in the temporary directory.

Duncan Murdoch