Nothing
R works, of course.
library(knitr) set.seed(123) rnorm(5)
Does knitr work with Python? Use the chunk option engine='python'
:
x = 'hello, python world!' print(x) print(x.split(' '))
Or use the syntax ```{python}
:
x = 'hello, python world!' print(x.split(' '))
If all the chunks below are python chunks, we can set the engine globally:
opts_chunk$set(engine = 'python')
You can use some chunk options like eval
, echo
and results
. For example, eval=FALSE
(do not evaluate code):
or echo=FALSE
(hide source code):
or results='hide'
:
or results='asis'
:
print('**Write** _something_ in `Markdown` from `Python`!')
You can also cache the computation:
import time # pretend this is a time-consuming task... time.sleep(10) print(1+1)
You can use strict markdown (i.e. indent by 4 spaces) by setting render_markdown(TRUE)
.
render_markdown(TRUE)
Now see how the output is changed:
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.