Writing temporary data from R

Posted by Shane on Stack Overflow See other posts from Stack Overflow or by Shane
Published on 2010-03-25T14:40:14Z Indexed on 2010/03/25 14:43 UTC
Read the original article Hit count: 357

Filed under:

I want to write some temporary data to disk in an R package, and I want to be sure that it can run on every OS without assuming the user has admin rights. Is there an existing R function that can provide a path to a temporary directory on all major OS's? Or a way to reference a user's home directory?

Otherwise, I was thinking of trying this:

Sys.getenv("temp")

I presume that I can't expect people to have write access to their R locations, otherwise I could reference a path within the package directory: .find.package("package.name").

© Stack Overflow or respective owner

Related posts about r