Admin's recently open document not opening for Student at first startup

As Admin, I have created an RStudio Cloud Project with a RMarkdown and set the Global Option to reopen the most recently open source file at startup. This works fine when I re-open the project as Admin.

However, the source file is not loaded at start-up when my students first open the RStudio Cloud Project as an Assignment.

How do I ensure that my Student gets the same experience of the RStudio Cloud Project with the correct file already opened, exactly as I last saved it, when the Student first opens the RStudio Cloud Project.

Phillip,

Unfortunately, IDE settings are NOT copied between an assignment and a derived project. This means that any settings, like the one you mentioned, will not be set when a student opens an assignment.

A possible workaround might be to use a combination of .RProfile and the rstudioapi package to achieve similar results, but I have not tested so I can't say for sure if it will work.

Regards,
-Andy

Thanks for your quick reply Andy,

I tried creating an .Rprofile file and it does seem to get executed when a student opens a project. I tried putting a nagivateToFile call in the .Rprofile file but that doesn't work "function not found". I tried adding install.packages("rstudioapi") into the .Rprofile file but that fails with the message could not function "install.packages"

Phil

I have created a Base Project in which I installed the rstudioapi package and RMarkdown packages.

Then I created a new project based on that Base Project and added an end file. In the console, I was able to successfully run library(rstudioapi) and navigateToFile("Hello.rmd"). So I put these commands into a .Rprofile file saved and shared the project as an Assignmrnt

However, the .Rprofile file never ran, neither for me as admin nor for a student.

Phil,

I did a little digging and I feel bad for leading you astray. It turns out this is a problem with RStudio IDE itself: https://github.com/rstudio/rstudioapi/issues/100, but there is a workaroud suggested in the linked ticket: https://github.com/rstudio/rstudio/issues/1579

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