write.list {erer}R Documentation

Output and Write a List Object

Description

Print or write its required argument z to a file

Usage

write.list(z, file, t.name = NULL, row.names = FALSE, ...) 

Arguments

z

A list object to be written. Each item in the list is perferably a data frame. If not, it is converted into a data frame. All the contents are coerced into characters to avoid loss of information (e.g., a loss of zero in 5.130.

file

a character string naming a file.

t.name

table names. This can be given explicitly, or given by the list name, or by default, named as "table 1" for the first item in z.

row.names

whether the row names in each table should be written (default is FALSE). If TRUE, a new column of the row names is added to each table.

...

Other arguments that can be passed to write.table

Details

This function is a wrap-up of write.table. It is convenient to write a set of tables to C drive.

See Also

write.table.

Examples


h1 <- ts(data=cbind(1:24), start=c(2001, 1), frequency=12)
h2 <- ts(data=cbind(1:24, 25:48), start=c(2001, 1), frequency=12)
h3 <- ts(data=cbind(1:4, 5:8, 9:12), start=c(2001, 1), frequency=4)
colnames(h2) <- c("aa", "bb")
colnames(h3) <- c("cc", "dd", "ee")
h1; h2; h3

test <- list(t1 = h1, t2 = h2, t3 = h3)

## Not run: 
  # test.csv can be saved at a specific working directory
  getwd(); setwd("c:/aERER"); getwd()
  write.list(z = test, file = "test.csv")

## End(Not run)

[Package erer version 3.1 Index]