[R] write.table column names shift

dennis11 detebeest at hotmail.com
Fri Sep 4 10:07:49 CEST 2009


Hi everyone,

I want to write some data to file, for example

a = c(1,2,3,4,5)
b = c(5,6,7,8,9)

write.table(cbind(a,b), file = "R output.csv", sep = ",")

The result is this:

a	b	
1	1	5
2	2	6
3	3	7
4	4	8
5	5	9

It added an index and shifted the column names by one, b is above a, and a
is above the added index.

Does anybody know a way to prevent this shift from happening? Thanks in
advance.

Kind regards,

Dennis
-- 
View this message in context: http://www.nabble.com/write.table-column-names-shift-tp25289490p25289490.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list