Tag: write.table

当有rownames时,write.table将不需要的前导空列写入标题

检查这个例子: > a = matrix(1:9, nrow = 3, ncol = 3, dimnames = list(LETTERS[1:3], LETTERS[1:3])) > a ABC A 1 4 7 B 2 5 8 C 3 6 9 表格显示正确。 有两种不同的方式将其写入文件… write.csv(a, 'a.csv')如预期的那样: "","A","B","C" "A",1,4,7 "B",2,5,8 "C",3,6,9 和write.table(a, 'a.txt')拧紧 "A" "B" "C" "A" 1 4 7 "B" 2 5 8 "C" 3 6 9 […]