As a follow-up to my questions of last night,
the attached file knittest_knit_.md, a small subset of the
ggplot2-0.9.0.Rnw document originally prepared for pdfLaTeX, was run
using knitr to create the output file knittest.md, visible at
https://github.com/djmurphy420/ggplot2-transition-guide/blob/master/knittest.md.
The attempt to create a table similar to that in the pdf document
didn't work, and the attempt to place graphics side by side in the
same row also failed. I realize that markdown is meant to be a simple
language, so it's possible to work around the multiple graph per line
problem if necessary (unless I can figure out an opts_chunk$set()
hook). I tried to mimic the example on the Github markdown page, but
no dice. Any assistance or pointers to relevant documentation would be
appreciated.
Dennis
2. since you are using ggplot2, you are free to remove the hook
knit_hooks$set(fig = function(before, options, envir){
if(before && options$fig.show != "none")
par(mar = c(4, 4, 0.1, 0.1), cex.lab = 0.95, cex.axis = 0.9,
mgp = c(2, 0.7, 0), tcl = -0.3)
} )
it was designed for base graphics only; ggplot2 does not use par().
3. for tables, you are right; the main idea of markdown is to be
simple, simple and simple; there are other "markdown" variants like
Textile/reStructedText which might support tables... I have not got a
chance to look at them yet.
Regards,
Yihui
--
Yihui Xie <xiey...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA
Regards,
Yihui
--
Yihui Xie <xiey...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA
<table>
<tr>
<td>one cell</td>
<td>another cell</td>
</tr>
</table>
If you want to generate tables from data, you can still use the xtable
package, e.g.
library(xtable)
print(xtable(head(iris)), type='html')
Regards,
Yihui
--
Yihui Xie <xiey...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA