schmettow / PfP_Book

Programming for Psychologists - a primer
0 stars 1 forks source link

configure reticulate #1

Open schmettow opened 6 years ago

schmettow commented 6 years ago

index.Rmd

lenabrandl commented 6 years ago

According to multiple sources, the reticulate package (which would enable both desired features) requires the preview version (or daily releases) of RStudio v1.2. It appears that unless we want to switch to the preview of RStudio v1.2, we have to be patient until its completion.

I tried to implement reticulate in RStudio v1.1.456, but as expected, it did not work.

Sources https://blog.rstudio.com/2018/03/26/reticulate-r-interface-to-python/ https://rstudio.github.io/reticulate/articles/rstudio_ide.html https://www.rstudio.com/products/rstudio/download/preview/

schmettow commented 6 years ago

I succesfully tested the following on reticulate in rmarkdown:

Note that for knitting individual files (chapters) of a book, it works best to directly call: rmarkdown::render("Test_reticulate.Rmd") rather than hitting any buttons in Rstudio.

lenabrandl commented 6 years ago

I see the misunderstanding now. I falsely expected reticulate to sustain one session between individually executed code chunks in the .Rmd file.

Sustaining one Python/R session and supressing code evaluation while knitting works, but sustaining one session between individually executed chunks does not. See the screenshot for clarification. screenshot 2018-09-09 14 59 48

schmettow commented 6 years ago

I see. That is probably with Rstudio 1.2. It is a little burden for the process of writing. Can we close the issue?

lenabrandl commented 6 years ago

RStudio is still defaulting to Python 3 on my system (still looking into that), so the issue isn't solved yet completely.