Open In App

Introduction to R Studio

Last Updated : 21 Jul, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

R Studio is an integrated development environment(IDE) for R. IDE is a GUI, where we can write your quotes, see the results and also see the variables that are generated during the course of programming. 

  • R Studio is available as both Open source and Commercial software.
  • R Studio is also available as both Desktop and Server versions.
  • R Studio is also available for various platforms such as Windows, Linux, and macOS.

Getting Started with R Studio

Rstudio is an open-source tool that provides Ide to use R language, and enterprise-ready professional software for data science teams to develop share the work with their team.

R Studio can be downloaded from its official Website (https://posit.co/) and instructions for installation are available on How to Install RStudio for R programming in Windows? 

After the installation process is over, the R Studio interface looks like: 

rstudio
R Studio
  • The Console panel (left panel) is where R waits for us to enter commands. This is the area where we write our code and see the output immediately.
  • On the top right, we have the Environment/History panel.
  • The Environment tab shows all the variables that have been created during our programming session.
  • The History tab keeps track of all the commands we’ve used so far in our current session.
  • On the bottom right, there is another panel that contains several useful tabs.
  • The Files tab displays the files and folders in the current working directory.
  • The Plots tab is used to display graphs and plots that we generate through our R scripts.
  • The Packages tab shows all the installed packages and allows us to install new ones.
  • The Help tab provides documentation and support for R functions.
  • The Viewer tab is used to view local web content generated within R.

Features of R Studio

  • A friendly user interface
  • writing and storing reusable programmes
  • All imported data and newly created objects (such as variables, functions, etc.) are easily accessible.
  • Comprehensive assistance for any item Code autocompletion
  • The capacity to organise and share your work with your partners more effectively through the creation of projects.
  • Plot snippets
  • Simple terminal and console switching
  • Tracking of operational history
  • There are numerous articles from RStudio Support on using the IDE.

Set the working directory in R Studio

R is always pointed at a directory on our computer. We can find out which directory by running the getwd() function. Note: this function has no arguments. We can set the working directory manually in two ways: 

  • The first way is to use the console and using the command setwd("directorypath"). 
    You can use this function setwd() and give the path of the directory which you want to be the working directory for R studio, in the double codes.
  • The second way is to set the working directory from the GUI. 
    To set the working directory from the GUI you have to click on this 3 dots button. When you click this, this will open up a file browser, which will help you to choose your working directory.
files
R Studio
  • Once you choose your working directory, you need to use this setting button in the more tab and click it and then you get a popup menu, where you need to select "Set as working directory".

This will select the current directory, which you have chosen using this file browser as your working directory. Once you set the working directory, you are ready to program in R Studio.

Create an RStudio project

Step 1: Select the FILE option and select create option.

Step 2: Then select the New Project option.

Step 3: Then choose the path and directory name.

Finally, project are created in a specific location:

  • getwd(): Returns the current working directory.
  • setwd(): Set the working directory.
  • dir(): Return the list of the directory.
  • sessionInfo(): Return the session of the windows.
  • date(): Return the current date.

Creating your first R script

Here we are adding two numbers in R studio. 

How to Perform Various Operations in RStudio

We'll see some common tasks, their codes in R Studio

Installing R packages

Syntax:

install.packages('package_name')

Loading R package

Syntax:

library(package_name)

Help on an R package

help(package_name)

R Studio, a versatile R IDE, supports open-source and commercial usage on various platforms. It streamlines data science tasks, from project creation to package management, with a user-friendly interface.


Next Article
Article Tags :

Similar Reads