directory=tempdir()
HTMLoutput=file.path(directory,"output.html")
graph1="graph1.png"
# Write graph to a file
if (FALSE) png(file.path(directory,graph1))
if (FALSE) plot(table(rpois(100,5)), type = "h", col = "red",
lwd=10,main="rpois(100,lambda=5)")
if (FALSE) dev.off()
# Insert graph to the HTML output
HTMLInsertGraph(graph1,file=HTMLoutput,caption="Sample discrete distribution plot")
Run the code above in your browser using DataLab