write.simple.tsv | R Documentation |
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.
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,
...
)
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() |
YourDataFrameWithRowAndColumnNames <- cbind("A" = rnorm(100), "B" = rpois(100, 8))
rownames(YourDataFrameWithRowAndColumnNames) <- letters[1:NROW(YourDataFrameWithRowAndColumnNames)]
write.simple.tsv(YourDataFrameWithRowAndColumnNames)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.