Help with Google CoLab environment
Draft
Mount Google drive
The following code assumes user has already signed into their Google account and permissions to access already set.
This first section runs Python code. Confirm runtime set to Python.
from google.colab import drive
drive.mount('/content/drive')
Expected Python output:
Mounted at /content/drive
Next, switch runtime to R. Install and load a Tidyverse package to work with Google drive.
install.packages("googledrive")
library(googledrive)
Expected R output
Installing package into ‘/usr/local/lib/R/site-library’ (as ‘lib’ is unspecified)
# Confirm if package is loaded search()
Get the name of the folder on My Drive. This example, the folder is “Colab notebooks.” Replace folder name with your folder, keeping the rest of the path.
setwd("/content/drive/MyDrive/Colab Notebooks")
Finally, confirm the working directory is set.
# The default working folder is '/content/drive' getwd()
Should be good to go!