write.df: Write a csv file

Description Usage Arguments Examples

View source: R/io.R

Description

Write a csv file

Usage

1
write.df(df, file.path, sep = ";", append = FALSE, header = FALSE)

Arguments

df

the object to be written, preferably a matrix or data frame.

file.path

Name of output file.

sep

the field separator string. Values within each row of x are separated by this string. Default ";" .

append

If TRUE, the output is appended to the file. If FALSE, any existing file of the name is destroyed. Defatul FALSE.

header

if TRUE, name of the columns are written in the first line. Default FALSE.

Examples

1
2
3
4
5
df = data.frame("V1" = 1:5, "V2" = c("a", "b", "c", "d", "e"), "V3" = c("alto", "bajo", "bajo", "alto", "alto"))
write.df(df, "bench1.txt")
write.df(df, "bench2.txt", header = TRUE)
write.df(df, "bench2.txt", append = TRUE)
write.df(df, "bench2.txt", sep = ";", header = FALSE, append = TRUE)

AnderEhu/sme documentation built on Jan. 31, 2022, 12:01 a.m.