The following code works, to gsub single quotes to double quotes: line <- gsub("'", '"', line)
(that's a single quote within doubles then a double within singles if your viewer's font is not good). But The R Language Manual tells me that Quotes and other special characters within strings are specified using escape sequences: \' single quote \" double quote so why is the following wrong: gsub("\\\\'", "\\\\"", line)? That or any other number of backslashes (have tried all up to n=6 just for good measure). BTW is it documented anywhere that you need four backslashes in an RE to match one in the target, when it is being passed as an argument to gsub or grep? How would I know how many levels of doubling up to use for any other functions? (I got to 4 consecutive \ by trial and error in this case, but have a dim memory of having read about it somewhere.) TIA Simon Fear Senior Statistician Syne qua non Ltd Tel: +44 (0) 1379 644449 Fax: +44 (0) 1379 644445 email: [EMAIL PROTECTED] web: http://www.synequanon.com Number of attachments included with this message: 0 This message (and any associated files) is confidential and\...{{dropped}} ______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help