Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Writing html from within R using knitr

Tags:

Maybe I am missing the obvious, but I have been struggling with finding an example for the following: I would like to write reports of my analysis in R to a html file using the knitr package. I have found the stitch() function, however it would be nice to have more control about which results & plots are written to html and which are not. In principal I would like to be able to code the following:

# some dummy code
library(ggplot)
data <- read.table('/Users/mydata', header=TRUE)
model <- lm(Y~X*Y, data)

# write this result to html:
summary(model)