Learn R Programming

dtables (version 0.2.0)

write_object: Write an object to a file

Description

A wrapper for write.table that saves an object by name to a tab delimited (.tsv) file with options to specify directory and include the current date in the file name.

Usage

write_object(object, dir = NULL, date = TRUE, overwrite = FALSE, row.names = FALSE, col.names = TRUE)

Arguments

object
a data.frame, matrix, or vector to write out
dir
a character string specifying the directory (folder) in which save the object, defaults to current working directory.
date
logical, if TRUE appends the object name with todays date
overwrite
logical, if TRUE overwrites existing file of same name
row.names
logical, if TRUE adds rownames to output file
col.names
logical, if TRUE adds column names to output file

Value

Returns nothing. Saves "object_date.tsv" or "object.tsv" to current directory.

Examples

Run this code
write_object(iris2)

Run the code above in your browser using DataLab