The \section
macro contains LaTeX type of text, but as you want to write code, you could use \synopsis
macro, i.e.
\synopsis
# some piece of R script will eventally provide this part of the text
}
There is one problem with this though; you cannot give name to this section, it is automatically named as another usage section. Same thing could be achieved by using \examples
macro, but now the name of the section is Examples, which is probably even more dubious (not to mention that you probably already have Examples section).