[R] How to write to a table column by column?

jim holtman jholtman at gmail.com
Mon Aug 13 12:12:02 CEST 2007


Assuming that the daily.incomes are the same lengths, then your loop could be:

Lst <- list()
for (i in 1:count) Lst[[i]] <- list(......)
Lst.col <- do.call('cbind', Lst)

On 8/12/07, Yuchen Luo <realityrandom at gmail.com> wrote:
> Dear friends.
> Every loop of my program will result in a list that is very long, with a
> structure similar to the one below:
>
> Lst <- list(name="Fred", wife="Mary", daily.incomes=c(1:850))
>
> Please notice the large size of "daily.incomes".
>
> I need to store all such lists in a csv file so that I can easily view them
> in Excel. Excel cannot display a row of more than 300 elements, therefore, I
> have to store the lists as columns. It is not hard to store one list as a
> column in the csv file. The problem is how to store the second list as a
> second column, so that the two columns will lie side by side to each other
> and I can easily compare their elements. ( If I use 'appened=TRUE', the
> second time series will be stored in the same column. )
>
> Thank you for your tine and your help will be highly appreciated!!
>
> Best
>
> Yuchen Luo
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>


-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?



More information about the R-help mailing list