I\'m writing some R notes with Sweave and would like to show common errors. For example,
<>= x = 5 #Case matters! x*X @ >
As Shane suggests, use
<>
for the code that will error, but you want to display, and then again with
but with the same code wrapped in a try.
There's an example here: http://tolstoy.newcastle.edu.au/R/help/05/09/11690.html