[R-pkg-devel] Saving binary files in a package

Hadley Wickham h.wickham at gmail.com
Sat Jul 4 10:36:07 CEST 2015


On Sat, Jul 4, 2015 at 10:00 AM, Dirk Eddelbuettel <edd at debian.org> wrote:
>
> On 4 July 2015 at 09:12, Thierry Onkelinx wrote:
> | You have no guarantee that the user has write access to those folders. So
> | you might want to rethink your strategy.
>
> Seconded. And I am not aware of a good cross-platform solution so your best
> bet may be to require the user to specify a filename.

One attempt to correctly locate the right place to save files (i.e.
the user data dir) is
http://cran.r-project.org/web/packages/rappdirs/index.html, a fork of
the python appdirs (https://github.com/ActiveState/appdirs). There's
no guarantee that these places will be writeable, but they're probably
a reasonably good place to start.

Hadley

-- 
http://had.co.nz/



More information about the R-package-devel mailing list