Skip to content

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

@MichaelChirico

Description

@MichaelChirico

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions