write.list: Output and Write a List Object

View source: R/write.list.r

write.listR 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.

Value

No return value

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)

# The above list file can be saved at a specific working directory.

erer documentation built on Sept. 26, 2024, 5:06 p.m.