I'm writing some R notes with Sweave and would like to show common errors. For example,
<<echo=TRUE, eval=TRUE>>=
x = 5
#Case matters!
x*X
@
However when sweaving, the document won't compile due to the R error. Is there any way to make sweave compile and show the (nicely formated) error?