what's the best way to generate a word-processor file (ideally as platform-independent as possible, but native Word formats will do), with images in it, from the statistical language R?
Find a desired location to save the file. From within the Save As Window, find the Save File Type field. Select the drop-down arrow, and change the file from Rich Text Format (rtf) to Word Document (doc). Select Save.
RTF files are encoded as text files that contain extra keywords for the formatting. You can basically open an RTF file with any text editor and find the text in various parts of the file. DOC files are not encoded as text and you cannot view the information without the correct application.
Microsoft Word Open XML Document (DOCX) files. This file format is based on Open XML and uses ZIP compression. It was introduced with Microsoft Word 2007. • Rich Text Format (RTF) files.
To start with, if you have any word processing apps installed—Microsoft Word, LibreOffice, OpenOffice, AbiWord, and so on—you can open an RTF file with it. Most file syncing services—like Dropbox, OneDrive, and Google Drive—have built-in viewers that let you at least read an RTF file, even if you can't edit it there.
The standard Sweave engine is one option if you can handle LaTeX - but I guess that is stretching the "word-processor file" aspect just a touch! Alternatively, odfWeave is a related package providing a new engine for Sweave that will work with OpenOffice.org documents.
There are other options on the Reproducible Research Task View on CRAN, although some of the MS Office oriented options require Windows specific cruft.
how about the R2wd package?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With