Re: [R-pkg-devel] How to write example results to a tempdir()?

2018-04-25 Thread Duncan Murdoch
On 25/04/2018 1:32 PM, Sarah Goslee wrote: Don't change the working directory! That has all kinds of unpleasant side effects for the unsuspecting user, possibly even more so than writing to a file. Instead, write the file to the temp directory, and read it from there, with e.g. wd <- tempdir()

Re: [R-pkg-devel] How to write example results to a tempdir()?

2018-04-25 Thread Uwe Ligges
On 25.04.2018 19:45, Jose A Guijarro wrote: Many thanks for your advise, Sarah! I will try to implement it. (Now I will have to change all my reading and writing sentences of all my functions, because they read/write from/to the users working directory...) Whcih is OK if the user specifies

Re: [R-pkg-devel] How to write example results to a tempdir()?

2018-04-25 Thread Jose A Guijarro
Many thanks for your advise, Sarah! I will try to implement it. (Now I will have to change all my reading and writing sentences of all my functions, because they read/write from/to the users working directory...) Best regards,     Jose El 25/04/18 a las 19:32, Sarah Goslee escribió: Don't

Re: [R-pkg-devel] How to write example results to a tempdir()?

2018-04-25 Thread Sarah Goslee
Don't change the working directory! That has all kinds of unpleasant side effects for the unsuspecting user, possibly even more so than writing to a file. Instead, write the file to the temp directory, and read it from there, with e.g. wd <- tempdir() write(dat, file.path(wd,

[R-pkg-devel] How to write example results to a tempdir()?

2018-04-25 Thread Jose A Guijarro
Dear all, I am struggling to update my package climatol from version 3.0 to 3.1. The old version had all examples under a "dontrun" section because they needed files created by other examples that the user had to run first. As this is not acceptable anymore, I made the examples runnable and