Skip to content

Instantly share code, notes, and snippets.

@jcheong0428
Created March 20, 2021 05:24
Show Gist options
  • Save jcheong0428/4f4194fb797219d4eed75ce4b44c3d91 to your computer and use it in GitHub Desktop.
Save jcheong0428/4f4194fb797219d4eed75ce4b44c3d91 to your computer and use it in GitHub Desktop.
Install R, Rpy2, LMER on Google Colab
!apt-get install r-base
!pip install -q rpy2
packnames = ('lme4', 'lmerTest', 'emmeans', "geepack")
from rpy2.robjects.packages import importr
from rpy2.robjects.vectors import StrVector
utils = importr("utils")
utils.chooseCRANmirror(ind=1)
utils.install_packages(StrVector(packnames))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment