0

Hi smart people of the internet:

I have a rmarkdown file with R and python chunks in it. I want to write a function or two in my python chunks that can affect my global environment in R. I know you can execute python strings within an R chunk but is there a converse?

Here is what I'm talking about:

```{r}
library(reticulate)
df <- iris
``
```{python}
df = r.df

# do something in R now such as `new.R.df <- py$df` or even just run any R function such as `View(iris)`
``

Thank you thank you thank you =)

Phil
  • 7,287
  • 3
  • 36
  • 66
user1713174
  • 307
  • 2
  • 7

0 Answers0