csv: Writes a CSV (comma separated values) file.

Description Usage Arguments Details Value See Also

View source: R/csv.R

Description

Write a matrix or Time Indexed Series to a .csv file that can be imported into a spreadsheet.

Usage

1
csv(z, file = "", noDates = FALSE, row.names = !is.tis(z), ...)

Arguments

z

matrix or tis object

file

either a character string naming a file or a connection. If "", a file name is constructed by deparsing z. The extension ".csv" is appended to the file name if it is not already there.

noDates

logical. If FALSE (the default) and z is a tis object, the first column of the output file will contain spreadsheet dates.

row.names

either a logical value indicating whether the row names of z are to be written along with z, or a character vector of row names to be written. If FALSE (the default) and z is a tis object, the first column of the output file will contain spreadsheet dates.

...

other arguments passed on to write.table.

Details

csv is essentially a convenient way to call write.table. If file is not a connection, a file name with the ".csv" extension is constructed. Next, a column of spreadsheet dates is prepended to z if necessary, and then csv calls

write.table(z, file = filename, sep = ",", row.names = !is.tis(z), ...)

Value

csv returns whatever the call to write.table returned.

See Also

write.table


tis documentation built on May 29, 2017, 8:18 p.m.