gentoo linux, version 2.4.1: > d= as.data.frame(matrix(1:20, 4, 5)) > d V1 V2 V3 V4 V5 1 1 5 9 13 17 2 2 6 10 14 18 3 3 7 11 15 19 4 4 8 12 16 20 > write.csv(d, file="d1.csv"); > write.csv(d, file=pipe("cat > d2.csv")) > write.csv(d, file=pipe("gzip -c > d3.csv.gz"), col.names=T) Warning message: attempt to change 'col.names' ignored in: write.csv(d, file = pipe("gzip -c > d4.csv.gz"), col.names = T)
exit and $ head d1.csv "","V1","V2","V3","V4","V5" "1",1,5,9,13,17 "2",2,6,10,14,18 "3",3,7,11,15,19 "4",4,8,12,16,20 $ head d2.csv "1",1,5,9,13,17 "2",2,6,10,14,18 "3",3,7,11,15,19 "4",4,8,12,16,20 is it a bug or a feature that when pipe is used, the col.names is set to false? I guess I can invoke write.table to get the headers back. regards, /iaw ______________________________________________ R-help@stat.math.ethz.ch 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.