Environment Setup

I know nothing about the dynamic behind, but I successfully set it up. I will introduce the procedure. I completely agree with Dr. Gruber at his post (Gruber 2022) :

I never really found an IDE that I liked. I tried a few different ones including Spyder and Jupyter Notebook (not technically an IDE) and compared to RStudio and R Markdown they felt rather limited. Most Python users I met seem to think IDEs are not really important, which confuses me even further. That’s what you look at the entire time while programming!

Once you got familiar with Rstudio, or anyway Posit IDE, you are spoiled, that is how I felt. Therefore, I decide to continue to teach and code in Rstudio, even with python or jupyter-note. Here, I use Zotero for reference and Typora for slides writing. I followed the post above to set the enviroment, the code is below, simple but works.

library(reticulate)
py_install('pandas')
py_install('matplotlib')
py_install('numpy')
py_install('jupyter')
py_install('scikit-learn')
reticulate::repl_python()
#virtualenv_install('matplotlib')
#os <- import("os")
#os$listdir(".")
#use_python("/opt/homebrew/bin/python3")
py_install('scikit-survival')

more on quarto, I learnt how to set this from youtuber (Robbins 2023) and her github.

What is the difference between qmd and rmd, I found an explain by Yihui Xie (Xie 2022) .

Reference

Gruber, Johannes. 2022. https://www.johannesbgruber.eu/post/2022-03-29-scikit-learn-models-in-r-with-reticulate/.
Robbins, Joyce. 2023. “How to Create a Web Site Using Quarto, RStudio, and GitHub Pages.” https://www.youtube.com/watch?v=YN75YXaLFGM.
Xie, yihui. 2022. “Quarto和R Markdown的区别?.” https://d.cosx.org/d/422901-quartor-markdown/10.