Is there a way in knitr for evaluating inline code snippets in other languages?

You knitrcan use other languages ​​in code blocks. For example, we can use:

```{python}
Some python code
```

We can use the built-in engine Rwith `r some R code`

Can I use other languages ​​in embedded code?

For example, I would like to do something like this `python some code`.

Thank.

+4
source share
1 answer

Rate string with `r shell (...)`

A shell command may be a python script that outputs the output for the embedded display. You can even pass the argument shell = python3.

+4
source

Source: https://habr.com/ru/post/1690799/


All Articles