Reputation: 8345
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?
Here is the documentation example document FIR_design.mdw rewritten in .Rmd format (for examples):
Upvotes: 5
Views: 798
Reputation: 10860
Instead of pweave -f pandoc <source>
try using pweave -i markdown <source>
.
If you do not provide the input format, it is deduced from file extension. As you can see in linked source, your input file needs to have the .md
extension for it to be auto-detected as "Pandoc markdown" formatted.
The default output format seems to be the same as input, or as provided with --format (-f)
.
Upvotes: 6