checkpoint: Save time storing longer analysis step on disk

Description Usage Arguments Value Note Author(s) Examples

View source: R/checkpoint.R

Description

This utility function can be used to save time on task that takes long time to complete. A Rda file are written on disk containing only objects setted to keep. If checkpoint function find related Rda file then this Rda will be loaded.

Usage

1
2
3
4
5
6
7
8
checkpoint(
  label,
  CODE,
  path = ".",
  overwrite = FALSE,
  verbose = FALSE,
  keep = NULL
)

Arguments

label

name of this code, will create a Rda file with the same name.

CODE

R code.

path

directory to write/load Rda file.

overwrite

Rerun CODE and replace Rda file.

verbose

argument passed to load function

keep

vector of object/variable name to keep. NULL means error.

Value

Nothing.

Note

Experimental function.

Author(s)

Welliton Souza

Examples

1
2
3
4
5
checkpoint("Rqc", path=system.file(package="Rqc", "extdata"), {
  folder <- system.file(package="ShortRead", "extdata/E-MTAB-1147")
  files <- list.files(full.names=TRUE, path=folder)
  rqcResultSet <- rqcQA(files, pair=c(1,1), workers=1)
}, keep="rqcResultSet")

labbcb/Rqc documentation built on Aug. 2, 2021, 8:43 a.m.