Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

csv

Writes a CSV (comma separated values) file.


Description

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

Usage

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


tis

Time Indexes and Time Indexed Series

v1.38
Unlimited
Authors
Jeff Hallman <jeffhallman@gmail.com>
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.