Tuesday, March 24, 2015

Start a new project with R Studio

Hello,


Today, we will see how to start a new project in R Studio.

Firstly, what is a project?

A project in R Studio is a work environment. When you start a new project:

  • A new R session is opened
  • Several history files are created (.Rprofile, .RData, .RHistory). They will help you find your commands and history when you will re-open this project later.
  • You choose a working directory (setwd() and getwd() in R without RStudio). 
  • All your R Studio settings for this project will be restored.

 These projects are really useful if you currently work on different datasets or studies!


Create a new project in R Studio

  • Open R Studio
  • Go to "files" (up left) and "New Project" 
  • Choose "Empty project"

  • Choose if you want to use an existing directory or create a new one.
  • Choose the directory that you want or choose the name of the new one and where it will be created. And click on "create project".
  • Done! RStudio will open your new work environment for this project. 
  • Now you can create a new R script to start programming in R. To do that, use "File, New File, R Script" or the icon on the top left. 


















Finally,  this is your new environment :


See you soon for a new article about R Studio! In the next one, we will see how to personalize R Studio.

Karine

No comments:

Post a Comment