What Was I Trying to Do?
I was trying to calculate VIF (Variance Inflation Factor) using VIF
function of car
package of R. In python, to import the car package, I used the importr
function of rpy2
as shown below.
from rpy2.robjects.packages import importr
car = importr('car')
Then, What Did Happen?
However, after running the codes in Google Colab, I got the following error.
PackageNotInstalledError: The R package "car" is not installed.
I understand that it is saying that the package car
is not installed.
Then, My Question
In Google Colab, I did not need to install any package like Keras, Pandas etc.. In fact, I did not need to install stats
package (to use via rpy2
) of R. Then, why will I need to install package like car
, usdm
, mtcars
to use via rpy2
? Also, I do not know how to install those packages to use through the rpy2
library.
How Did I Try to Solve?
I searched on Google to find the ways to use (via rpy2
) those packages (e.g. car
, mtcars
) in Google Colab. However, I failed to find the ways. It can be noted that I can use those packages (e.g. usdm
, car
) via rpy2
in Jupyterlab Notebook (after installing). However, I want to use those packages in Google Colab.
Any type of help will be greatly appreciated!