How to mount google drive to R notebook in colab?

前端 未结 3 1815
慢半拍i
慢半拍i 2021-01-04 23:11

I have an R notebook in colab where I want to read a file which is saved in my google drive.

I only seem to find python code such as \"from google.colab import driv

3条回答
  •  萌比男神i
    2021-01-04 23:46

    Start using python:

    from google.colab import drive
    drive.mount('/content/drive')
    

    Then load the R Magic:

    %load_ext rpy2.ipython
    

    and then activate the R Magic and load your data:

    %%R
    url = ('/content/drive/myDrive/folder1/myfile.csv')
    dataset = read.csv(url)
    

提交回复
热议问题