overwritef: a wrapper for file overwrite

Description Usage Arguments Details Value Examples

View source: R/utils_p.R

Description

typical usage is to pass any function that has a file argument, i.e. save(), pdf() and so on

Usage

1
overwritef(FUN, file, overwrite = TRUE, ...)

Arguments

FUN

a function to pass

file

a file including path

overwrite

TRUE or FALSE

...

additional parameters for FUN

Details

this allows us to decide whether to overwrite existing file in a directory.

Value

Ord indicator if there is overwriting happen so that further code can be conditionally run, i.e. plot

Examples

1
2
3
4
5
6
pdfOR(file='test.pdf', overwrite=TRUE)
plot(rnorm(100))
dev.off()
overwritef(pdf, file='test.pdf', overwrite=TRUE)
plot(1:3)
dev.off()

nickytong/GenAnalysis documentation built on July 20, 2019, 8:57 a.m.