简体   繁体   English

如何更改 RStudio 中的默认工作目录

[英]How to change the default working directory in RStudio

I am trying to change the default working directory in RStudio (Version 1.4.1103) in mac ("Wax Begonia" (458706c3, 2021-01-06) for macOS).我正在尝试更改 mac 中 RStudio(版本 1.4.1103)中的默认工作目录(macOS 的“Wax Begonia”(458706c3,2021-01-06))。 And I followed the instruction here ( How do you change the default directory in RStudio (or R)? ).我按照这里的说明进行操作( How do you change the default directory in RStudio (or R)? )。 After I change the directory under Tools |在我更改工具下的目录后 | Global Options, however, the working directory stay the same even though I restarted RStudio.全局选项,然而,即使我重新启动 RStudio,工作目录仍然保持不变。 Is there anything else I could try.还有什么我可以尝试的。

Thank you!谢谢!

You can set the working directory using setwd() .您可以使用setwd()设置工作目录。 Inside of setwd() you need to provide the path to the folder you want to be your working directory, such as setwd("C:/Desktop") .setwd()内部,您需要提供要成为工作目录的文件夹的路径,例如setwd("C:/Desktop") I typically set the working directory everytime I open R studio.我通常在每次打开 R 工作室时设置工作目录。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM