I am generating a report containing several R scripts in the appendix. Is there any way to "beautify" the R source codes in microsoft word, similar to what we see in tinn-R ? Thanks _________________________________________________________________ [[alternative HTML version deleted]]
Open script in Tinn-R, select script to copy. Then use menu Edit:Copy formatted (to export) --> RTF Paste into MS word. --Dale On Sat, Sep 13, 2008 at 1:30 PM, Daren Tan <daren76 at hotmail.com> wrote:> > I am generating a report containing several R scripts in the appendix. Is there any way to "beautify" the R source codes in microsoft word, similar to what we see in tinn-R ? > > Thanks > _________________________________________________________________ > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >
Or use the software Highlight: http://www.andre-simon.de/ (Remember that you may need to change the R definition file 'r.lang' using the function highlight.def() in package 'animation') P. S. sorry Dale, I often forget to click "Reply to all" and as a result, send my reply to a single person :-( Yihui On Sun, Sep 14, 2008 at 1:30 AM, Daren Tan <daren76 at hotmail.com> wrote:> > I am generating a report containing several R scripts in the appendix. Is there any way to "beautify" the R source codes in microsoft word, similar to what we see in tinn-R ? > > Thanks-- Yihui Xie <xieyihui at gmail.com> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main Building, Renmin University of China, Beijing, 100872, China
And if you don't want to type spaces or indent manually when you write your code, you may also use the function 'tidy.source()' (in the package 'animation') to add spaces and indent automatically. For example: http://animation.yihui.name/animation:misc#tidy_up_r_source Hope this will "beautify" your code more :) Yihui On Sun, Sep 14, 2008 at 1:30 AM, Daren Tan <daren76 at hotmail.com> wrote:> > I am generating a report containing several R scripts in the appendix. Is there any way to "beautify" the R source codes in microsoft word, similar to what we see in tinn-R ? > > Thanks-- Yihui Xie <xieyihui at gmail.com> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main Building, Renmin University of China, Beijing, 100872, China