[R] New behavior of 'write.csv' append argument?

Steven Worthington steven.worthington at gmail.com
Tue Jun 1 02:33:16 CEST 2010

Dear R users,

I have recently begun to reuse some functions I made several months ago. The
scripts write to a .csv file using the 'write.csv' function with the append
option set to TRUE. This used to work fine, albeit with the warning
"appending column names to file". I upgraded to R version 2.11.0 on OSX
10.5.8 and 'write.csv' will no longer append any files - I get the warning
"attempt to set 'append' ignored". The exact same object will append when
using 'write.table' without issue. Here's a minimal example. Has there been
a change in 'write.csv'?

# --------------------------------
x <- rnorm(10, 5)
y <- rnorm(10, 10)
z <- rnorm(10, 15)
dat <- data.frame(x, y, z)
names(dat) <- c("first", "second", "third")

write.csv(dat, file="dat.csv", append=TRUE)
write.table(dat, file="dat2.csv", sep=",", row.names=FALSE, append=TRUE)
# --------------------------------


View this message in context: http://r.789695.n4.nabble.com/New-behavior-of-write-csv-append-argument-tp2237936p2237936.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list