Sweave from the utils package allows for formatting code, prose, graphs and tables together in a LaTeX document.
Sweave
utils