[Rd] write.table doesn't quote column names properly (PR#7171)

From: <jpalmucci_at_machineinsight.com>
Date: Sat 14 Aug 2004 - 14:27:26 EST


Full_Name: Jeff Palmucci
Version: trunk
OS: Windows
Submission from: (NULL) (207.180.176.235)

write.table doesn't quote the column names using qmethod.

Here is the diff of the fix with revision 30658

svn diff write.table.R
Index: write.table.R


+

+    qstring <-                          # quoted embedded quote string

+ switch(qmethod,
+ "escape" = '\\\\"',
+ "double" = '""')
+ if(!is.null(col.names)) { if(append) warning("appending column names to file") if(!is.null(quote)) - col.names <- paste("\"", col.names, "\"", sep = "") + col.names <- paste("\"", gsub('"', qstring, col.names), "\"", sep = "") writeLines(paste(col.names, collapse = sep), file, sep = eol) } if (NROW(x) == 0) return(invisible(x)) - - qstring <- # quoted embedded quote string - switch(qmethod, - "escape" = '\\\\"', - "double" = '""') + for(i in quote) x[, i] <- paste('"', gsub('"', qstring, as.character(x[, i])), '"', sep = "") ______________________________________________
R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sat Aug 14 14:31:18 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:45:07 EST