samedi 2 juillet 2016

Using an R Markdown style document (.Rmd) as input for Pweave


I'm trying to run a basic R Markdown document (that calls python in code chunks) through Pweave. In the Pweave documentation it states that you can declare code chunks using the style ```{python}. However when I try to compile using, for example, pweave -f pandoc FIR_design.mdw the chunks are not run and instead placed in verbatim.

All the examples in the documentation use the noweb syntax e.g.

<<fig = True, width = '12 cm', echo = False>>=
from pylab import *
plot(arange(10))
show()
@

The markdown equivalent would be:

```{python, fig = True, width = '12 cm', echo = False}
from pylab import *
plot(arange(10))
show()
```

When I try to run the examples using the markdown syntax it simply adds them in verbatim and doesn't run the chunk. Is this expected? If so, how should I be converting my .Rmd documents to make them runable in Pweave. Must I convert them to noweb style?


Aucun commentaire:

Enregistrer un commentaire