Member-only story
Like Python, R now is available in Google Colab Notebook. You can use it by using command %load_ext rpy2.ipython or change it to R in the Runtime type.
We need to install and import required packages (libraries) but these installed packages will be reset/ removed every time you revisit the notebook. We can reinstall them, but it could take long time for some large packages. So, we would like to show you how to expedite the process by
- zipping the installed packages.
- saving them in the google drive.
- moving back to the lib
- unzipping the files
When you first open Colab notebook, you can find there are only few folders. When we try to import library tidyquant and it is showing no package called ‘tidyquant’.
So let’s install the package and zip it and saved it into Google Drive folder src.
%%R
install.packages('tidyquant')