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.
On Fri, 4 Sep 2009 01:07:49 -0700 (PDT) dennis11 <detebeest at hotmail.com> wrote: D> It added an index and shifted the column names by one, b is above a, D> and a is above the added index. Try the option row.names=FALSE in write.table then no index is written. Stefan
Seemingly Similar Threads
- write.table when keeping column headers (names of Columns in matrix) and row numbers
- Shift-by-signext - sext is bad for analysis - ignore it's use count?
- funnel shift, select, and poison
- Shift-by-signext - sext is bad for analysis - ignore it's use count?
- funnel shift, select, and poison