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

write.csv.tabular

Write table to file in CSV or other format.


Description

This writes the formatted table into a CSV or other delimeted file, for import into a spreadsheet or other report writer.

Usage

write.csv.tabular(x, file="", 
    justification = "n", row.names=FALSE, ...)
write.table.tabular(x, file="", 
    justification = "n", row.names=FALSE, col.names=FALSE, ...)

Arguments

x

An object from tabular.

file

A filename or connection to which to write.

justification

Parameter to pass to format.tabular.

row.names, col.names

Parameters to pass to write.csv or write.table

...

Parameters to pass to format.tabular or write.table; see Details below.

Details

write.csv.tabular writes a simple version of the table (similar to what is produced by print.tabular) to the given connection in CSV format, using write.csv. write.table.tabular does similarly using the more general write.table.

The optional arguments in ... are sent to write.csv/write.table if their names exactly match parameters to write.table; otherwise, they are sent to format.tabular.

Value

The return value from write.csv or write.table.

Examples

## Not run: 
# This writes a table to the clipboard on Windows using tab delimiters, for
# easy import into a spreadsheet.

write.table.tabular( 
    tabular( (Species + 1) ~ (n=1) + Format(digits=2)*
         (Sepal.Length + Sepal.Width)*(mean + sd), data=iris ),
    "clipboard", sep="\t")

## End(Not run)

tables

Formula-Driven Table Generation

v0.9.6
GPL-2
Authors
Duncan Murdoch
Initial release

We don't support your browser anymore

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