Skip to contents

write_file() is the backbone of all write_cnt() methods, where files are written to a connector. The function is a wrapper around write_ext() where the appropriate function to write the file is chosen depending on the file extension.

write_ext() has methods defined for the following file extensions:

Usage

write_file(x, file, ...)

write_ext(file, x, ...)

# S3 method for class 'txt'
write_ext(file, x, ...)

# S3 method for class 'csv'
write_ext(file, x, ...)

# S3 method for class 'parquet'
write_ext(file, x, ...)

# S3 method for class 'rds'
write_ext(file, x, ...)

# S3 method for class 'xpt'
write_ext(file, x, ...)

# S3 method for class 'yml'
write_ext(file, x, ...)

# S3 method for class 'json'
write_ext(file, x, ...)

Arguments

x

Object to write

file

character() Path to write the file

...

Other parameters passed on the functions behind the methods for each file extension.

Value

write_file(): invisible() file.

write_ext(): The return of the functions behind the individual methods.

Examples

# Write CSV file
temp_csv <- tempfile("iris", fileext = ".csv")
write_file(iris, temp_csv)