Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I generate a document (.rtf, .doc, .odt) from R

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?

like image 317
John Lawrence Aspden Avatar asked Nov 10 '10 16:11

John Lawrence Aspden


People also ask

How do I convert RTF to DOC?

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.

What is the difference between RTF and DOC?

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.

What is DOC DOCX RTF?

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.

Does word support RTF?

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.


2 Answers

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.

like image 196
Gavin Simpson Avatar answered Nov 05 '22 15:11

Gavin Simpson


how about the R2wd package?

like image 42
eliavs Avatar answered Nov 05 '22 13:11

eliavs