[R] convert to csv file

David Winsemius dwinsemius at comcast.net
Fri Sep 17 05:15:52 CEST 2010


On Sep 16, 2010, at 10:55 PM, lord12 wrote:

>
> In order to use the extension csv, is the syntax:
>
> write.table(table_list, file= paste("file", x, sep = "").csv, sep =  
> ",") ?

Nope. You cannot just tack strings on the end of function calls. Try:

write.table(table_list, file= paste("file", x, ".csv", sep = ""), sep  
= ",")

?paste
?write.table
 > x="test"
 > paste("file", x, ".csv", sep = "")
[1] "filetest.csv"


> Also I pretty much create a table by
> doing:
>
> table_list= cbind(c1,c2,c3,c4) where c1...c4 are vectors.

Doesn't look very efficient but should work.

> -- 

David.



More information about the R-help mailing list