How to use R with Google Colaboratory?

后端 未结 6 1487
误落风尘
误落风尘 2020-11-29 16:59

Google Colaboratory supports Python version 2.7 and 3.6

I see an example how to use Swift in Colab a while ago.

Today, I happened to run

!jup         


        
6条回答
  •  醉话见心
    2020-11-29 17:21

    In case you want to use Python and R together, you can use R magic for some cells.

    # activate R magic
    %load_ext rpy2.ipython
    

    Then, whenever you want to use R, you begin the cell with %%R

    %%R
    x <- 42
    print(x)
    

    More details in rpy2 documentation

提交回复
热议问题