Conda environments

List the Conda environments.

library(reticulate)
options(reticulate.repl.quiet = TRUE)

conda_list(conda = "auto")

Activate the environment sage-bionetworks.

use_condaenv("sage-bionetworks", required = TRUE)

Combining R and Python

Define a variable in R.

counter <- 1

Access R objects in Python code blocks using the prefix r..

r.counter += 1
message = 'hello-world'

Resume working with the variable a in R.

counter
## [1] 2

Access Python objects in R code blocks using the prefix py$.

py$message
## [1] "hello-world"