epi_write: Write files with a consistent convenience function

View source: R/epi_write.R

epi_writeR Documentation

Write files with a consistent convenience function

Description

epi_write() writes files with a consistent convenience function. Wraps data.table's fwrite with several assumptions as defaults.

Usage

epi_write(
  file_object = NULL,
  file_name = "my_file.tsv",
  row.names = FALSE,
  quote = FALSE,
  sep = "\t",
  na = "NA",
  col.names = TRUE,
  ...
)

Arguments

file_object

Object to write

file_name

file name as a string, default is 'my_file.tsv'

row.names

as for data.table::fwrite(), default is also FALSE

quote

as for data.table::fwrite(), default is FALSE

sep

as for data.table::fwrite(), default is tab separated

na

as for data.table::fwrite(), default is 'NA'

col.names

as for data.table::fwrite(), default is also TRUE

...

pass any other data.table::fwrite() parameters

Value

None

Note

Other parameters as specified by data.table::fwrite() You are probably better off using the standard write.csv(), data.table::fwrite() directly or other functions unless you are writing out several similarly constructed objects. Files are written with data.table. Column names are written, row names are not, quotes are not used. Columns are tab separated. NAs are written as 'NA'. Assumes the first row in the object is a header.

Author(s)

Antonio Berlanga-Taylor <\url{https://github.com/AntonioJBT/episcout}>

See Also

fwrite

Examples


## Not run: 
epi_write(some_dataframe, 'some_dataframe.tsv')

## End(Not run)


AntonioJBT/episcout documentation built on Dec. 1, 2024, 4:07 a.m.