Why Rstudio doesn't open scripts from projects when they are moved to a new machine?
2
1
Entering edit mode
9.3 years ago
Parham ★ 1.6k

Hi,

I recently moved a lot of my Rstudio projects from a desktop computer to my laptop. Surprisingly when I open the projects on my laptop it doesn't bring back the scripts I have in them. I checked back with the desktop and they are fine and it opens them. Is there any known solution to that? Let me know if any further information can help.

Best!

R projects scripts Rstudio • 8.9k views
ADD COMMENT
0
Entering edit mode

I normally save scripts on my google drive and then run them across my desktop PC and my mac laptop...the first thought is to check your paths and working directories. do you have any setwd() commands in your scripts? are the same libraries installed in both? also, have you tried different machines too? if the script is not big and you want to try to share it here we can check whether it works on our machines

ADD REPLY
0
Entering edit mode

Thanks for looking into it. First of all I must say that I am saving projects made by Rstudio not just scripts, in case I was not clear. Then for the rest of instructions you gave me, I created a test-project with x <- 2 in the source, then ran it so the x object is present in the environment. So I have one object in environment and one line of code in source. I saved it over two clouds (Google Drive and OneDrive) and opened the projects from two other computers, but it doesn't load the code line. I assume it doesn't need to have all the libraries that the original R has. Is there anything that I am missing?! Thanks for your help in advance.

ADD REPLY
1
Entering edit mode
9.3 years ago
TriS ★ 4.7k

I tried with my Rstudio and this is what I did.

  1. Create new project on PC
  2. In the "files" tab at the bottom right of the screen click on the project
  3. In "project options" select "yes" for the first two options
  4. On the other machine the top right corner lick on "projects" -> "project options" and select the same two things in 3)
  5. Once you are done (i initially created x <- 2 and x2 <-6) quit R on the PC
  6. Wait a few min for Google Drive to sync (make sure everything is sync'd)
  7. Open the new project on mac
  8. Got my x and x2 variables in it
ADD COMMENT
0
Entering edit mode

That's true, I also do get x and x2. My point is how I can make it to load x <- 2 and x2 <- 6 into the workspace? Imagine I am having a big chunk of code on the original computer that I am working on it. I want to close the Rstudio at work and open the project at home and continue working on the codes. If it doesn't bring back the codes there is no point in it at all.

Thanks in advance.

ADD REPLY
0
Entering edit mode
9.3 years ago
Parham ★ 1.6k

Now I see what I was missing. The source panel needs to be saved also, otherwise its context only shows up when the project is opened on the original computer. My thought was that when I save a project, Rstudio saves all panels data automatically.

ADD COMMENT

Login before adding your answer.

Traffic: 2453 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6