Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up examples which produce files as a side effect? #40

Open
MichaelChirico opened this issue Oct 24, 2024 · 0 comments
Open

Clean up examples which produce files as a side effect? #40

MichaelChirico opened this issue Oct 24, 2024 · 0 comments

Comments

@MichaelChirico
Copy link

MichaelChirico commented Oct 24, 2024

plotAlignedAnalytes(AlignObjOutput)

IINM this is leaving a file around on the user's system e.g. during R CMD check (AlignedAnalytes.pdf).

It would be better for the examples to clean up after themselves. I get that example(plotAlignedAnalytes) is probably supposed to leave it there for the user to inspect, so I'm not sure the right way to go about this. Two suggestions:

  1. Put the plotting code behind \dontrun{} and make the user run it manually; leave a comment in the example explaining why so the user knows about this side-effect.
  2. Write a "fake" Rd file whos \examples{} only consist of \dontshow{ try(unlink("AlignedAnalytes.pdf")) } that removes the file, put only under R CMD check where all examples are run.
  3. Change the code so that instead of plotting to PDF by default, it plots to the default device (e.g. the plot window in interactive() sessions)

Similar for .tsv file outputs from

alignTargetedRuns2(dataPath = ".", params = params, outFile = "te1.tsv", ids = ids, applyFun = BiocParallel::bplapply)

progAlignRuns2(dataPath = ".", params = params, outFile = "prog.tsv", ropenms = ropenms, ids = ids, applyFun = BiocParallel::bplapply)

@MichaelChirico MichaelChirico changed the title Clean up example? Clean up examples which produce files as a side effect? Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant