with_tempfile: Call a function with a temporary file.

Description Usage Arguments Value Examples

View source: R/io.R

Description

Call a function with a temporary file.

Usage

1

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

1
2
3
4
5
6
7
8
## Not run: 
data(iris)
with_tempfile(function(file_name) {
 write.csv(iris, file_name)
 # add'l operations
})

## End(Not run)

civisanalytics/civis-r documentation built on June 27, 2020, 7:25 a.m.