with_tempfile: Call a function with a temporary file.

View source: R/io.R

with_tempfileR Documentation

Call a function with a temporary file.

Description

Call a function with a temporary file.

Usage

with_tempfile(fn, ...)

Arguments

fn

a function that takes a filename as the first argument.

...

arguments passed to to fn.

Value

object the return value of fn

Examples

## Not run: 
data(iris)
with_tempfile(function(file_name) {
 write.csv(iris, file_name)
 # add'l operations
})

## End(Not run)


civis documentation built on April 1, 2023, 12:01 a.m.