New project from git repo - installed packages not inherited from base project


Thanks for this great product!

I have a base project for a teaching workspace with R version 3.6.3 with several packages installed.

When a student creates a new project in Rstudio Cloud with the New Project option, the installed packages are inherited from the base project and the R version is preserved at 3.6.3.

When a student creates a new project in Rstudio Cloud with the New Project from Git Repo option, the installed packages are not inherited and the R version launched is 4.0.0.

I think this is related to this problem RStudio Cloud - Package Installation Issue but I'm not really sure how to proceed.

Any thoughts?

I had the same issue when I started using GitHub for my classes. Unless you use packrat or better yet renv, the students will have to install the packages themselves. Packages used in a project are not automatically sent to Git. I have found it harder to get my students to use packrat or renv than simply having them install packages as needed.

Edit: Are you using RStudio Cloud or having the students use their own local installations of RStudio. What I wrote above applies to when each student has a local copy of RStudio and they download a starter project from GitHub.

1 Like

Thanks for the quick reply! I've edited the question for clarity. They are using Rstudio Cloud.

Hi @fjunior,

Thanks for your post and your kind words -- I think this is actually a different issue and has to do with how git-based projects are created. We are tracking this problem, and will work on a fix. In the mean time, two possible work-arounds:

  1. This bug causes new git-based projects to select the most recent version of R by default. Can you ask your students to select R version 3.6.3 once their git-based projects open? Once they've done this, they shouldn't have to do it again, and they should have access to the packages your base project specifies (these packages should be installed for R version 3.6.3, but they're not showing up because R version 4.0.0 is selected).


  1. Can you update your base project to use the latest version of R? This won't help existing git-based projects, unfortunately, and may not be possible for your scenario, but it would align your base project's R version with what new git-based projects will default to, and the packages should appear in new projects as expected.

I know neither of these options are great, but I hope one of them helps you while this bug exists.

Thank you,

Hi @mel,

Thanks for the answer!

I've updated my base project to the latest version of R and installed the required packages.

To be honest I didn't know I could do that simply by selecting a different version of R!

Kind Regards,

Francisco Alves

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.