Re: [R] write.table with append=T after using cat on same file

2015-07-28 Thread PIKAL Petr
Scott R > Sent: Monday, July 27, 2015 10:32 PM > To: R. Help > Subject: [R] write.table with append=T after using cat on same file > > 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 &

Re: [R] write.table with append=T after using cat on same file

2015-07-27 Thread William Dunlap
Missing words: Use 'TRUE' and 'FALSE' instead of 'T' and 'F' >to avoid< this sort of problem Bill Dunlap TIBCO Software wdunlap tibco.com On Mon, Jul 27, 2015 at 1:50 PM, William Dunlap wrote: > This will happen if you have redefined 'T': > > T <- 101:104 > > write.table(df, file="junk.tx

Re: [R] write.table with append=T after using cat on same file

2015-07-27 Thread William Dunlap
This will happen if you have redefined 'T': > T <- 101:104 > 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 Use 'TRUE' and 'FALSE' instead of 'T' and 'F' this sort of problem. Bil

Re: [R] write.table with append=T after using cat on same file

2015-07-27 Thread Mark Sharp
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 > wrote: > > Hi, > > For years I've been writing text t

[R] write.table with append=T after using cat on same file

2015-07-27 Thread Waichler, Scott R
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=