You can do this with xtable
, which can write tables directly to HTML. Here is an example markdown document:
Title
========================================================
My regression table.
```{r chunkTest, echo=FALSE, results='asis'}
library(xtable)
data(tli)
fm3 <- glm(disadvg ~ ethnicty*grade, data = tli, family = binomial())
fm3.table <- xtable(fm3)
# Coefficients
print(fm3.table, type = "html")
# Analysis of variance.
print(xtable(anova(fm3)), type = "html")
```
If you want the stars, there is a lovely package called texreg
which can output with stars, and has some other nice features that xtable
doesn't.
```{r chunkTest1, echo=FALSE, results='asis'}
library(texreg)
htmlreg(fm3,single.row=TRUE)
```