RStudio Cloud - issues with loading packages for assignments

I teach an introductory R class, and we use RStudio Cloud. This year (semester) I have been running in lots of issues with packages - that I've never had before. This is the third year I am teaching this class.

I have existing assignments from previous years, and I did already figure out I had to re-open all of them first before sharing them with my students, because RStudio Cloud told me:

Project Requires Upgrade
This project is currently using a version of the operating system that is no longer supported.

We will upgrade it to a new version of the operating system before opening it.

But then, in my assignment (and projects with code that I make available to my students to study and practice), the R version is set to 4.0.5. I install tidyverse (for instance), and make sure that library(tidyverse) also works.
Then, after making the assignment available, I get inundated by messages from students that they can't get the package to load. My first thought is that they are maybe working in version 4.2.1 - so I instruct them to switch to 4.0.5. Then it seems like it works for some, but not for others. Through some trial and error (and dozens of student messages), I have figured out that if the students switch to or are working in 4.0.5 and they run install.packages("tidyverse") themselves, library(tidyverse) throws errors - see attached screenshots.
So, I think the solution is now to make sure that all assignments are set to 4.2.1 and that I install the packages for that version?
But:
a) why do the assignments open in 4.0.5 for me? But not for my students? I think? Still haven't figured out what is going wrong there?
b) Why does re-installing tidyverse manually (as opposed to the "reinstalling packages" function that runs when I get the upgrade message) not work for version 4.0.5?

All of this is causing severe frustrations with my students - that are already new to R. It also causes a lot of additional work on my side to troubleshoot this. This defeats the whole purpose of paying for RStudio Cloud; to reduce learner (and instructor) frustration and delays due to installation issues...

Any help or guidance would be highly appreciated!
Message from one student:


When I checked the project of another student who was having issues:

They are working with older versions of several packages, including tidyverse dependencies so when they run install.packages("tidyverse") they are updating to the latest tidyverse version and the installation process complaints about old package dependencies' versions. This is something to expect, if you do not lock your package library with something like renv for reproducibility. But in my opinion an R programming course should always get updated to use the latest package versions so the content stays relevant.

I totally agree! I just hadn't realized that my "updated version" of the assignment would open in 4.0.5, but then it seems that for the students it opened up in 4.2.1? I don't believe any of the students changed to 4.2.1 themselves.
I am now trying to set up all the assignments to open with the correct (newest) version, with all packages installed. I was just surprised that this happened. And since these students are all very new to R and RStudio, it was difficult to get the correct details on what was going on...

Also - another question about making assignments and materials available. When I have accidentally had the project set to version 4.0.5 when I made it available to students, and I go into my version of the project (the one they are copying from) and change the version to 4.2.1, will students who make a copy after I make that change get the project in 4.2.1 automatically?
I understand that students who already made a copy before that change might get the project in the older version (or not? Still not sure about this?) - but I just want to make sure that I don't have to do any sort of update.

I'm not a teacher and I have never used RStudio Cloud for teaching purposes so these are just my thoughts as a learner. I think that if your students are very new to R and you don't want them to be exposed to package installation problems, maybe you should make sure all required packages are already present in the base project and explicitly tell them not to install any other packages in those specific assignments.

On the other hand, in my own learning path, I learned the basics of setting up my R environment before actually learning the language, It seemed weird at the time but considering how often you need to deal with this sort of thing in the real-world I think is an extremely valuable skill to learn from the beginning.

Yes, that is my understanding but let's wait for RStudio people to weigh in to be sure

Regarding

maybe you should make sure all required packages are already present in the base project and explicitly tell them not to install any other packages in those specific assignments.

that is exactly what I do... Multiple times... But there are always people who don't read/listen properly, or don't know/understand why I am giving those instructions, and they do it anyway... Believe me...

And I don't disagree that learning how to deal with installation issues is useful, but I teach an intense 6 week course, and the last thing I want to do is "lose" people because they are overwhelmed by these issues (these are all non-computer science learners). I want them to get started straightaway and get excited about R (so that when the going gets rough, they hang in there, lol). This is a very specific teaching and learning strategy.
Also - in this 6 week format, people can easily get behind a week or more due to installation issues - and not to mention working directory issues. That causes major logistical problems (late assignments etc). And considering this is a course with 50+ learners, I would spend the first 2 weeks troubleshooting and get completely behind on grading, content, etc.
We talk about doing a local installation at the end of the course, and they can still contact me about that after the course is done.

I'm not sure if this will be inherited from the base project when students make a local copy (I can't test it since I don't have an instructor's account) but a possibility would be to set the CRAN repository to use a looked repository from the public RStudio Package Manager, this gets locked to a specific date so unless they explicitly change the repository they could not update to newer package versions.

Maybe an option for this on the management console would be a nice feature to add for instructor accounts.

1 Like

Definitely... And what would also be nice, would be to have a "student view" so I know what the students see when they make a copy of an assignment or a non-assignment project. Right now I am telling them "I think there is a button on the top-right where you can save the project, etc", but I am actually not sure. I know I can go into their assignment / projects if they ask me for help, but that's usually after they've already messed around, so I can't see the original settings they started out with...

When I first taught this class, I made myself a student by adding myself using my gmail account (so I could see what the students see), but since our university has gone to institutional access, it only allows access with institutional emails - which of course is my instructor account...

Hi Geraldine,

Thanks for reporting this issue. It sounds like there is a complicated interaction that is causing an issue for you. I suspect there might be a bug, so I would like to gather some more information.

For context: assignments work by creating a point in time copy of the project the first time a student opens the assignment. Subsequent changes to the original assignment will not be reflected in the student's copies of it. This includes not only things like files and installed packages but some project settings like the R version that is in use. Any student who starts the assignment after making changes will receive a copy with those changes, including the R version selected. One thing to note is that changing the R version from R 4.X to R 4.Y will require you to reinstall the packages.

a) why do the assignments open in 4.0.5 for me? But not for my students? I think? Still haven't figured out what is going wrong there?

This should not happen. Students should get whatever R version you have selected in the assignment. Do you have a project ID for a student copy where this happened so we can investigate?

b) Why does re-installing tidyverse manually (as opposed to the "reinstalling packages" function that runs when I get the upgrade message) not work for version 4.0.5?

The reason that install.packages() may not work after the OS upgrade is that the old packages need to be completely removed before installing new ones because the old ones may contain references to operating system packages that could be out of date. The upgrade process handles this correctly by using renv::rebuild() to cleanly reinstall everything.

I totally agree! I just hadn't realized that my "updated version" of the assignment would open in 4.0.5, but then it seems that for the students it opened up in 4.2.1?

Again, this shouldn't happen, so if you are able to provide us with an example project, we would be happy to investigate further.

Also - another question about making assignments and materials available. When I have accidentally had the project set to version 4.0.5 when I made it available to students, and I go into my version of the project (the one they are copying from) and change the version to 4.2.1, will students who make a copy after I make that change get the project in 4.2.1 automatically?

Yes. They should. Keep in mind you will need to reinstall your R packages for the new R version.

When I first taught this class, I made myself a student by adding myself using my gmail account (so I could see what the students see), but since our university has gone to institutional access, it only allows access with institutional emails - which of course is my instructor account...

Allowing instructors to impersonate the student role without having to create multiple accounts is on our roadmap.

Lastly, I want to apologize for the headache this caused you. The more you're able to share with us, the more likely we'll be able to track down what went wrong here. A general bit of advice, I do recommend updating your old projects from time to time to ensure you are on the latest OS version and consider updating to the latest R version at that time as well.

-Andy

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.