First R Project
What should do when using RStudio is to create a Project for each different job. If your work does not contain confidential data, you can also use the GitHub repository as a backup or share what you are working on. You can create a new project in RStudio as follows.
Select New Project from the File menu,

New Directory: if you don’t have a folder yet, you can make it the working directory for the project.
Existing Directory: If your folder already exists.
Version Control: If you want to create a project based on an existing repository, for example on GiHub or SVN.
Because we are going to create a new project and we don’t have a folder yet, we will select New Directory.
On form Project type select New Project
firstly create your own folder that will become your project’s directory for example above “D:/rstudio-project”. Then type the directory name for example “intro”. Click Create Project.
How to create new R Script file
To create a new script editor in RStudio, you can click the File menu >> New File >> R Script.
In R you can simply write “Hello!” in the script editor or write with R code print(“Hello!”), then Run or press the Ctrl + Enter button when the cursor is on the script line because the R script runs sequentially line by line and what will be executed first is the line where the cursor is active.
Next, to save the script into a file, you can do this by a) clicking the save symbol, b) selecting the File >> Save or Save As… menu or c) using the shortcut by pressing the Ctrl + S keys.
Then set to the location of the folder where to save the script file. Next, provide a file name in the File name as follows. Finally click Save.
Congratulation! you have successfully make R programmes. Next you can try another R programmes as many as you want.