write.tab: write table with different defaults

View source: R/write.tab.R

write.tabR Documentation

write table with different defaults

Description

calls write.table with (personally) useful default values for the arguments. if open=TRUE, tries to open the file in the default txt viewer.

Usage

write.tab(
  x,
  file = NULL,
  sep = "\t",
  name_rn = NULL,
  row.names = FALSE,
  col.names = !is.null(colnames(x)),
  quote = FALSE,
  fileEncoding = "UTF-8",
  open = TRUE,
  ...
)

Arguments

x

Objekt to be written.

file

Filename. DEFAULT: NULL = [name of x].txt

sep

Column separator. DEFAULT: "\t"

name_rn

If not NULL, this will be used as the name for a prepended column with the rownames. DEFAULT: NULL

row.names

Should rownames be written in a pre-column that will mess up alignment with column names? Use name_rn instead. DEFAULT: FALSE

col.names

Should colnames be written? DEFAULT: TRUE if x has colnames

quote

Write quatation marks around charstrings? DEFAULT: FALSE

fileEncoding

Encoding of charstrings. DEFAULT: "UTF-8"

open

Try to open the output file? DEFAULT: TRUE

...

Further arguments passed to write.table

Value

full filename

Author(s)

Berry Boessenkool, berry-b@gmx.de, Sep 2021

See Also

write.tab

Examples

# Don't run on CRAN test machines:
## Not run: 
write.tab(iris)
write.tab(iris, "otherfile.txt")
write.tab(freeny)
write.tab(freeny, name_rn="Time")
unlink("iris.txt")
unlink("otherfile.txt")
unlink("freeny.txt")

## End(Not run)

berryFunctions documentation built on May 29, 2024, 4:01 a.m.