R and Python in one Jupyter notebook

前端 未结 5 709
春和景丽
春和景丽 2020-12-02 04:59

Is it possible to run R and Python code in the same Jupyter notebook. What are all the alternatives available?

  1. Install r-essentials and create R notebooks in J
5条回答
  •  無奈伤痛
    2020-12-02 06:04

    UPDATE April 2018,

    RStudio has also put out a package: https://blog.rstudio.com/2018/03/26/reticulate-r-interface-to-python/

    for which it is possible to run multiple code chunks in different languages using the R markdown notebook, which is similar to a jupyter notebook.

    In my previous post, I said that the underlying representation of objects is different. Actually here is a more nuanced discussion of the underlying matrix representation of R and python from the same package: https://rstudio.github.io/reticulate/articles/arrays.html

    Old post:

    It will be hard for you to use both R and Python syntax in the same notebook, mostly because the underlying representation of objects in the two languages are different. That said, there is a project that does try to allow conversion of objects and different languages in the same notebook: http://beakernotebook.com/features

    I haven't used it myself but it looks promising

提交回复
热议问题