write.simple.tsv: write.simple.tsv

View source: R/ReadWriter.R

write.simple.tsvR Documentation

write.simple.tsv

Description

Write out a matrix-like R-object WITH ROW- AND COLUMN- NAMES to a file with as tab separated values (.tsv). Your output filename will be either the variable's name. The output file will be located in "OutDir" specified by you at the beginning of the script, or under your current working directory. You can pass the PATH and VARIABLE separately (in order), they will be concatenated to the filename. If col.names = NA and row.names = TRUE a blank column name is added, which is the convention used for CSV files to be read by spreadsheets.

Usage

write.simple.tsv(
  input_df,
  separator = "\t",
  extension = "tsv",
  filename = substitute(input_df),
  suffix = NULL,
  manual_file_name = NULL,
  manual_directory = NULL,
  row_names = TRUE,
  col_names = NA,
  gzip = FALSE,
  o = FALSE,
  v = TRUE,
  ...
)

Arguments

input_df

Your Dataframe with row- and column-names

separator

Field separator, such as "," for csv

extension

e.g.: tsv

filename

The base name for the output file. Default: Name of the input vector.

suffix

A suffix added to the filename, Default: NULL

manual_file_name

Specify full filename if you do not want to name it by the variable name.

manual_directory

Specify the directory where the file should be saved.

row_names

Write row names? TRUE by default

col_names

Write column names? NA by default, TRUE if row_names == FALSE

gzip

Compress the file after saving? FALSE by default

o

Open the file after saving? FALSE by default

v

verbose Print path? Default: TRUE.

...

Additional arguments passed to write.table()

Examples

YourDataFrameWithRowAndColumnNames <- cbind("A" = rnorm(100), "B" = rpois(100, 8))
rownames(YourDataFrameWithRowAndColumnNames) <- letters[1:NROW(YourDataFrameWithRowAndColumnNames)]
write.simple.tsv(YourDataFrameWithRowAndColumnNames)


vertesy/ReadWriter documentation built on Nov. 24, 2024, 10:40 p.m.