This is simply user error: the column names _are_ written to the pipe.
Because the connection was not open, the connection is opened to write the
column names, closed, opened to write the data and then closed.
In any case, you should call close() on connections you create to avoid
leaking
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: