rm_tmp: Remove temporary files

Description Usage Examples

View source: R/rm_tmp.R

Description

Remove files in the R session's temporary directory. This function is useful in conjunction with packages like raster and aws.s3, which frequently write files to tempdir().

Usage

1

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
tmp_csv <- tempfile(fileext = rep(c(".csv", ""), 10))
lapply(tmp_csv, function(path) write.csv("", path))

list.files(tempdir())

rm_tmp(pattern = "\\.csv")
list.files(tempdir())

rm_tmp()
list.files(tempdir())

coletl/coler documentation built on May 12, 2021, 9:44 p.m.