[R] export list to csv

Henrique Dallazuanna wwwhsd at gmail.com
Wed Mar 16 16:03:24 CET 2011


Use dput:

dput(l, file = "l_str.txt")

Then, to read again:

l <- dget(file = 'l_str.txt')

On Wed, Mar 16, 2011 at 11:55 AM, andrija djurovic <djandrija at gmail.com> wrote:
> Hi everybody.
>
> I have list like this:
>
> l<-list(data.frame(q1=c(1,2,"check"),q2=c(3,"check",5)),
> data.frame(q1=c("check",1),q2=c(4,5)))
> names(l)<-c("A","B")
> rownames(l[[1]])<-c("aa","bb","cc")
> rownames(l[[2]])<-c("aa","bb")
>
> Every object has the same number of columns but different number of rows.
> Does anyone know if it is possible to export such kind of list, into one csv
> file, and  keeping all the names?
>
> Thanks in advance
>
> Andrija
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org 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.
>



-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O



More information about the R-help mailing list