I found that I can keep comments in the Sweave code chunks by specifying keep.source in the \SweaveOpts, but is there a way to make the code listing look nice like with grayed out comments?
There are several options illustrated at Vanderbilt University's Department of Biostatistics sweave templates site: http://biostat.mc.vanderbilt.edu/wiki/Main/SweaveTemplate
I found the Sweavel style to be the most flexible.
The highlight package is another option.
the pgfSweave
package can produce syntax-highlighted code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With