R/R_Usage [Eng.]

Rstudio_ working directory default setting

Cha-Nyong 2022. 11. 7. 20:10

Hello,

 

When you work on RStudio, you should notify which directory are you using. 

Because, the output files will be created on working directory.

 

Here is the method of default setting of working directory.  

 

 

1. Run the RStudio and you can see the below picture.

Here you can set working directory by default.

 

 

 

 

 

 

 

2. Open the Global Option and fill in directory in 

   R sessions where you want to get output files.

Strong point of this method is you can open Rscript directly from here.

 

 

 

 

 

 

3. Working Directory setting by command

 

getwd() #현재 내가 어디서 작업을 하고 있는지 알려주는 명령어

setwd("C:/usr/path/to/what/you/want/") #path to what you want 라는 하위 또 그 하위 폴더가 작업공간

getwd() #한 번 더 입력함으로써 작업 공간이 바뀌었는지 확인

 

 

 

The end of Rstudio Working Directory Default setting!