Last active
January 4, 2016 18:56
-
-
Save bbolker/065af65d7010917a994d to your computer and use it in GitHub Desktop.
runr test with persistent python3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "runr test" | |
date: "`r format(Sys.time(), '%H:%M %d %B %Y ')`" | |
author: Ben Bolker | |
--- | |
```{r opts,message=FALSE,echo=FALSE,warning=FALSE} | |
library("knitr") | |
library("runr") | |
py <- proc_python() | |
py$start() | |
knit_engines$set(python = function(options) { | |
knitr:::wrap(py$exec(options$code), options) | |
}) | |
opts_chunk$set(tidy=FALSE,engine='python',engine.path='python3') | |
``` | |
```{r chunk1} | |
a = 1 | |
``` | |
```{r chunk2} | |
print(a) | |
``` | |
```{r chunk3,engine="R"} | |
runif(1) | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment