[Bioc-devel] Re-direction of internally generated output files

Martin Morgan martin.morgan at roswellpark.org
Sat May 28 21:17:30 CEST 2016


Hi Jil --

On 05/28/2016 02:36 PM, Jil Sander wrote:
> Dear all,
>
>
>
> I am very new to the package development process and I am facing a
> beginner's issue I suppose.
>
>
>
> The main function of my package automatically saves output files of
> intermediate steps (PDF result files as well as R objects containing data)
> into the current working directory and re-uses them. Due to the example I
> incorporated into the help file of the corresponding function (since I need
> a specific amount of executable examples), those output files are generated
> automatically and are saved into the top-level folder of the package, which
> is obviously not allowed. Is this generally bad practice and if not, is
> there a recommend and elegant way how to solve this? E.g. adding a folder
> whose name is accepted to be present in the top-level folder and
> re-directing the output to it or suppressing the output without the need of
> changing the code?

Use tempdir() and possibly tempfile() to output data into a location 
where you can write things without making a mess of the user's file system.

It's worth asking why you need to save the intermediate files? It isn't 
a common practice in established packages. If it's because your code 
takes a very long time to compute, it might help to see if it can be 
written more efficiently (e.g., by isolating a small portion that takes 
a long time to evaluate, and asking for guidance here in a way that 
others can reproduce what you're doing).

Martin

>
>
>
> Thank you very much in advance and kind regards
>
>
>
> Jil
>
>
>
>
>
>
>
>
>
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> Bioc-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel
>


This email message may contain legally privileged and/or...{{dropped:2}}



More information about the Bioc-devel mailing list