Thanks to @kohske (I had just about figured this out for myself ...)
purl()
has a documentation
argument, which is set to 1 by default (1=add chunk headers to code; 0 does nothing, 2 adds chunk headers as roxygen comments). If you want to stick to knit(.,tangle=TRUE)
you just need to opts_knit$set(documentation=1)
before tangling.