[R] LaTeX consistent publication graphics from R and Comparison of GLE and R
Yihui Xie
xie at yihui.name
Sat Oct 6 18:58:36 CEST 2012
You can do everything in R and leave the dirty job to it the
tikzDevice package. For example, we can draw these charts with the
diagram package. To make things a little bit easier, we can put the
code in an Rnw document and compile with knitr. Attached is an example
of what we can achieve with:
\documentclass{article}
\begin{document}
<<flowchart, dev='tikz', cache=TRUE>>=
library(diagram)
demo('flowchart')
@
\end{document}
Note tikzDevices is not back to CRAN yet:
http://r.789695.n4.nabble.com/tikzDevice-not-available-td4640395.html
Regards,
Yihui
--
Yihui Xie <xieyihui at gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA
On Sat, Oct 6, 2012 at 8:14 AM, Frank Harrell <f.harrell at vanderbilt.edu> wrote:
> Hi Marc,
>
> It would be interesting to compare with tikz for ease of use.
>
> As an aside I've been wishing that someone would write an R function for
> creating clinical trial disposition charts using tikz or pstricks ...
>
> Best,
> Frank
>
> Marc Schwartz-3 wrote
>> On Oct 5, 2012, at 3:32 PM, clangkamp <
>
>> christian.langkamp@
>
>> > wrote:
>>
>>> Hi Everyone
>>>
>>> I am at the moment preparing my thesis and am looking at producing a few
>>> Organigrams / Flow charts (unrelated to the calculations in R) as well as
>>> a
>>> range of charts (barcharts, histograms, ...) based on calculations in R.
>>>
>>> For the Organigrams I am looking at an Opensource package called GLE at
>>> sourceforge, which produces the text part in Latex figures which is very
>>> neat and also in the same style of the thesis, which I wrote in LaTeX. It
>>> also offers a range of graphical features, and I am quite tempted.
>>>
>>> It also produces barcharts and histograms with the options of legends
>>> etc. I
>>> have done most of my graphs so far with R, but with Organigrams and flow
>>> charts I am at a loss (A pointer here would also be very welcome). For
>>> some
>>> charts I have used MS Visio, but it would be convenient to use just one
>>> program for graphing throughout the thesis (i.e. same colour coding
>>> etc.).
>>>
>>> Does anybody have any experience with GLE, ideally working with it with
>>> CSV
>>> tables generated within R ? Or does there exist another way to generate
>>> 'visually LaTeX consistent' graphics within R ?
>>>
>>> Any takers ?
>>
>>
>>
>> If you are comfortable in LaTeX, I would suggest that you look at
>> PSTricks:
>>
>> http://tug.org/PSTricks/main.cgi
>>
>> I use that for creating subject disposition flow charts for clinical
>> trials with Sweave. I can then use \Sexpr{}'s to fill in various
>> annotations in the boxes, etc. so that all content is programmatically
>> created in a reproducible fashion.
>>
>> There are some examples of flow charts and tree diagrams here:
>>
>>
>> http://tug.org/PSTricks/main.cgi?file=pst-node/psmatrix/psmatrix#flowchart
>>
>> and there are various other online resources for using PSTricks.
>>
>> Keep in mind that since this is PostScript based, you need to use a latex
>> + dvips + ps2pdf sequence, rather than just pdflatex.
>>
>> Regards,
>>
>> Marc Schwartz
>>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 051-flowchart.pdf
Type: application/pdf
Size: 613045 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20121006/6aa872e1/attachment-0002.pdf>
More information about the R-help
mailing list