Introduction to R Studio

R Studio is an integrated development environment(IDE) for R. IDE is a GUI, where you 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 version.
  • R Studio is also available for various platforms such as Windows, Linux, and macOS.

R Studio can be downloaded from its official Website rstudio.com 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:

  • The console panel(left panel) is the place where R is waiting for you to tell it what to do, and see the results that are generated when you type in the commands.
  • To the top right, you have Environmental/History panel. It contains 2 tabs:
    • Environment tab: It shows the variables that are generated during the course of programming in a workspace which is temporary.
    • History tab: In this tab, you’ll see all the commands that are used till now from the start of usage of R Studio.
  • To the right bottom, you have another panel, which contains multiple tabs, such as files,
    plots, packages, help, and viewer.

    • The Files tab shows the files and directories that are available within the default workspace of R.
    • The Plots tab shows the plots that are generated during the course of programming.
    • The Packages tab helps you to look at what are the packages that are already installed in the R Studio and it also gives a user interface to install new packages.
    • The Help tab is the most important one where you can get help from the R Documentation on the functions that are in built-in R.
    • The final and last tab is that the Viewer tab which can be used to see the local web content that’s generated using R.

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.
  • 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.

    My Personal Notes arrow_drop_up

    Check out this Author's contributed articles.

    If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

    Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


    Article Tags :

    1


    Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.