The command

    notangle -Rcmp.R compiler.nw

extracts the file cmp.R to standard output.

To build the pdf version:

    noweave -delay compiler.nw > compiler.tex
    pdflatex compiler.tex