I do not get an error with R-3.2.1 on Mac OS. You may have done something prior 
to this code so that perhaps F is not FALSE or T is not TRUE.

R. Mark Sharp, Ph.D.
msh...@txbiomed.org





> On Jul 27, 2015, at 3:32 PM, Waichler, Scott R <scott.waich...@pnnl.gov> 
> wrote:
> 
> Hi, 
> 
> For years I've been writing text to the beginning of files with cat(append=F) 
> , then following that text with data written by write.table(append=T).  It is 
> now giving me an error message.  I'm using R-3.1.2.  What gives?
> 
> df <- data.frame(x = 1, y = 1:10, z = 10:1)
> cat(file="junk.txt", sep="", "# An introductory note.\n")
> write.table(df, file="junk.txt", sep=",", append=T, quote=F, row.names=F, 
> col.names=F)
> 
> Error in file(file, ifelse(append, "a", "w")) : invalid 'open' argument
> 
> Thanks,
> Scott Waichler
> Pacific Northwest National Laboratory
> Richland, WA  USA
> 
> ______________________________________________
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Reply via email to