Old-school [🇷 for BE/BA]
Hi ElMaestro,
my experiences and workflow: I don’t like the HTML produced by R (and *.html, *.doc, *.xls generated by commerical SW like Phoenix/WinNonlin as well). In many cases the HTML is not valid and/or contains a lot of inline-CSS. Awful. After import it takes ages to get the format right.
my experiences and workflow: I don’t like the HTML produced by R (and *.html, *.doc, *.xls generated by commerical SW like Phoenix/WinNonlin as well). In many cases the HTML is not valid and/or contains a lot of inline-CSS. Awful. After import it takes ages to get the format right.
- I create a project folder. Subfolders for documents, R-code, R-output (separately for text and graphs).
- In the R-code I define variables for text- and plot-output, e.g.,
textpath <- "/foo/bar/baz/R-output/text/"
plotpath <- "/foo/bar/baz/R-output/plot/"
- For plain text I have two methods.
Either I format everything already within R (bysprintf()
,formatC()
) and send the result directly to a file bycat(yourresult, file=paste0(textpath, "yourfilename", ".txt", sep="\n", append=TRUE)
. In Office (Word, OOWriter) I import this file. I have a special paragraph-template with a monospaced font.Lucida Console
8–9 pt comes handy.
In the other method (mainly for tables with numeric results) I format numbers withsignif(foo, bar)
and usesep="\t"
. Import again, highlight, and convert text to table. Useful if you have rows with different decimal figures. Now I can define decimal tabs in order to center the columns nicely.
- Plots are a little bit tricky. First of all, I never copy/paste from the
R Graphics Device
. Even if the plot contains just 256 colors, it will be 24bit and the screen’s resolution in the clipboard. Rescaling in Office might look awful (at the latest when you print to PDF).
The support of SVG in OO is limited (politely speaking) and nonexistent in M$ Office. If your plot comes with ≤256 colors and does not contain an alpha-channel (=semitransparency) plotting to an EMF (win.metafile()
) is the method of choice. After import and printing to a PDF you get a nice scalable vector-format. Caution: If your plot contains colored surfaces (like these ones), forget it. The EMF-files will be extremely large and might even crash OO.
If you are working with 24-color and/or semitransparency (like this one)png()
is the way to go. In my experiencejpeg()
– even with a high quality setting – has some drawbacks. Even if you tell your PDF-driver not to compress JPGs again, artifacts may appear.
—
Dif-tor heh smusma 🖖🏼 Довге життя Україна!![[image]](https://static.bebac.at/pics/Blue_and_yellow_ribbon_UA.png)
Helmut Schütz
![[image]](https://static.bebac.at/img/CC by.png)
The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
Dif-tor heh smusma 🖖🏼 Довге життя Україна!
![[image]](https://static.bebac.at/pics/Blue_and_yellow_ribbon_UA.png)
Helmut Schütz
![[image]](https://static.bebac.at/img/CC by.png)
The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
Complete thread:
- Report in R – is that uphill or what? ElMaestro 2016-03-05 23:14 [🇷 for BE/BA]
- Report in R – R-Studio & R Markdown d_labes 2016-03-06 13:25
- Old-schoolHelmut 2016-03-06 15:57
- Report in R – is that uphill or what? yjlee168 2016-03-07 11:52
- Report in R – is that uphill or what? ElMaestro 2016-03-07 13:36
- Report in R – is that uphill or what? Shuanghe 2016-03-07 17:38
- To R or not to R d_labes 2016-03-08 07:49