How do you change the default directory in RStudio (or R)?

后端 未结 4 1951
没有蜡笔的小新
没有蜡笔的小新 2020-12-10 10:33

I consulted http://www.rstudio.com/ide/docs/using/workspaces and tried the setwd code and clicking on More --> Set as working directory options. However, the ne

4条回答
  •  臣服心动
    2020-12-10 11:02

    I faced the same problem. There are different way to changes you working directory in RStudio, some of them are, for example:

    setwd("~/R/R Programming") #Note that ~ represents in a short way your document folder (or whatever folder you are using for) and what its before it.

    Set our working directory without using squigless:

    setwd("C:\Users\Usuario\Documents\R\R Programming")

    Does the same thing using forward slashes:

    setwd("C:/Users/Usuario/Documents/R/R Programming")

    I got the information from the following link (though there are another options you can find in the video, recommended): https://www.youtube.com/watch?v=x_QnNhQ3jfY

提交回复
热议问题