Temporarily create a tempfile, which is automatically removed afterwards.
with_tempfile( new, code, envir = parent.frame(), pattern = "file", tmpdir = tempdir(), fileext = "" ) local_tempfile( new = NULL, envir = parent.frame(), pattern = "file", tmpdir = tempdir(), fileext = "" ) with_tempdir( code, clean = TRUE, pattern = "file", tmpdir = tempdir(), fileext = "" ) local_tempdir( pattern = "file", tmpdir = tempdir(), fileext = "", .local_envir = parent.frame(), clean = TRUE )
new |
|
---|---|
code |
|
envir |
|
pattern | a non-empty character vector giving the initial part of the name. |
tmpdir | a non-empty character vector giving the directory name |
fileext | a non-empty character vector giving the file extension |
clean |
|
.local_envir |
|
[any]
The results of the evaluation of the code
argument.
withr
for examples