[R] Exporting tables to RTF?

From: Aaron Solomon Adelman <aaron.solomon.adelman_at_gmail.com>
Date: Wed 05 Jul 2006 - 04:26:07 EST


Yesterday I managed to jury-rig a system to get a table out of R and import it into Nisus Writer Express (a word processor for Mac OS X). What I came up with is brittle, since it depends on an AppleScript script which has to be in a specific location and on no one touching the computer, since the AppleScript remotely controls Nisus Writer Express rather blindly and will make it do something wrong if everything is not exactly where it expects it to be.

There has to be a more robust way of doing this.

Ideally, I'd like to have R translate one of its tables into a table in an RTF file and then have Nisus Writer Express open the file. Has anyone written any code to do the RTF file-writing part? (I didn't find anything in CRAN. The second part I can do easily enough.)

Alternatively, I could try to get rid of the external AppleScript and control Nisus Writer Express directly from R. However, to do that, I need to use system() to pass commands to the shell to pass commands to AppleScript to pass commands to Nisus Writer Express. I haven't gotten this to work because I haven't managed to figure out how to formulate the escape codes. My AppleScript commands have to be in the form of:

tell application "Nisus Writer Express" to <do something or other>

Can anyone tell me how to escape such statements so I can pass them to osascript (a shell program that runs AppleScript) and (by extension) pass them to system()?

Thanks in advance for any help anyone can provide.


Aaron Solomon (ben Saul Joseph) Adelman
E-mail: Aaron.Solomon.Adelman@gmail.com, adelmaas@musc.edu Web-sites:
http://weirdthingoftheday.blogspot.com/ , http:// people.musc.edu/~adelmaas/
AOL Instant Messenger & Yahoo! Messenger: Hiergargo ICQ: 258691118
Jabber: Aaron.Solomon.Adelman@gmail.com

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Jul 05 04:31:00 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 05 Jul 2006 - 06:16:18 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.