1

I am working with knitr, polymode, ess and I would like to export just the R code from my .Rnw into a .R file. A basic file might look something like this:

\documentclass[a4paper]{article} My Rnw file <<>>= ##This is some R code 1+1 @ \end{document} 

In the end, I would like an R file with just

##This is some R code 1+1 

1 Answer 1

2

In R, tangling is implemented via knitr::purl and utils::Stangle.

ESS provides an interface to these commands. See the variable ess-swv-processor and the ess-swv-weave function (bound to M-n s in Rnw-mode).

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.