Re: [R] Generating the Ctrl-M character

2011-11-11 Thread Ashim Kapoor
The \r\n worked as the the diff can see no difference between my program's file and the file generated from the windows computer. For David, I use Emacs whitespace mode to see the spaces and the \n's. The \r does not show up in the whitespace mode. Maybe there is some way of turning it on. but T

Re: [R] Generating the Ctrl-M character

2011-11-10 Thread Jeff Newmiller
No need to get defensive... I couldn't tell whether you remembered the details. This is starting to go OT, though. As to handing "\n" as expected, in the context of generating text files for their native platforms they do act "as expected". However, in the context of people writing binary char

Re: [R] Generating the Ctrl-M character

2011-11-10 Thread David Winsemius
On Nov 10, 2011, at 11:55 PM, Jeff Newmiller wrote: Wow, Deadpan David. How about using the escape sequence "\r"? So shoot me. It wasn't documented in a manner that I recognized in the places I looked. ?character ?Syntax ?Constants And I did look at ?Quotes where "\r" is listed but did

Re: [R] Generating the Ctrl-M character

2011-11-10 Thread Jeff Newmiller
Wow, Deadpan David. How about using the escape sequence "\r"? Keep in mind that Ctrl-M is used as the end-of-line character on some operating systems, so accomplishing this may not be portable, and you didn't specify your operating system. On the three main platforms (*nix, Windows/DOS, and Mac

Re: [R] Generating the Ctrl-M character

2011-11-10 Thread David Winsemius
On Nov 10, 2011, at 9:35 PM, Ashim Kapoor wrote: Dear R-helpers, I want to append a Ctrl-M character to a string and then save it to a text file. mystring<-"This is a test." # How do I add a Ctrl-M to it in the end ?? cat(mystring,file="testfile") > cntrl_m <- intToUtf8(13) > cat(cnt

[R] Generating the Ctrl-M character

2011-11-10 Thread Ashim Kapoor
Dear R-helpers, I want to append a Ctrl-M character to a string and then save it to a text file. mystring<-"This is a test." # How do I add a Ctrl-M to it in the end ?? cat(mystring,file="testfile") Many thanks, Ashim [[alternative HTML version deleted]] _