Skip to main content
v2026.11,858 entries · CC-BY 4.0

How to Use RStudio: Panes, Projects and Your First Script

How to use RStudio for research: projects, scripts, packages and what each pane does, based on Posit’s official documentation.

Written and maintained by CASRAI Editorial Board

Last updated

To use RStudio, create a Project for your analysis, open a new R Script in the Source pane, and run each line with Ctrl+Enter (Cmd+Enter on a Mac) so the results appear in the Console. The panes around that script then show your objects, files, plots and help pages. This guide maps each pane to a research task and sets out a reproducible workflow built on Posit’s own documentation.

What RStudio is

The RStudio IDE is an integrated development environment for R, the statistical programming language. R itself is a language you run by entering commands, and RStudio is the interface most R learners are directed to for entering them. The two are separate: you write R code, and RStudio is where you write, run and inspect it. If you are still deciding whether R is the right tool, see CASRAI’s comparisons SPSS vs R and R vs Stata.

Who makes it and where it runs

RStudio is made by Posit Software, PBC, formerly named RStudio, PBC. Posit’s documentation lists a desktop version for Windows 11, macOS 15 and later, and Linux, and describes open source and commercial editions. For the download pointer and current system requirements, start from the RStudio IDE user guide.

The panes, and what each is for in research work

RStudio’s window is divided into panes. Posit’s documentation defines each one; the right-hand column connects them to common research tasks.

Pane What Posit says it does Research use
Source View and edit code-related files Keep your analysis in scripts, Quarto or R Markdown files rather than typed once into the console
Console An area to interactively execute code Try a command quickly; run package installs
Environment Shows the currently saved R and Python objects Check that your data frames loaded and look as expected
History Commands executed in the current session, with search Recover a command you ran earlier in the session
Files Interactive exploration of the current project and its directory Find your data files and outputs inside the project folder
Plots Static images generated by code until the session is restarted Preview figures, then save them from code so they can be regenerated
Packages View installed R packages See which packages are installed on this machine
Help Package documentation and vignettes Read how a function is meant to be used
Viewer Web content such as Shiny apps and Quarto-generated web pages Preview reports and interactive apps

Two points follow from these definitions. Environment and History are different things: the Environment shows what objects exist now, while History lists the commands you ran, so neither replaces a saved script. And because Plots are only kept until the session restarts, a figure that matters should be produced by code in a script.

Using RStudio step by step

  1. Create a project. Choose File > New Project > New Directory > New Project. Posit’s getting-started guidance is to use one project per analysis, which keeps data, scripts and outputs together.
  2. Create a script. Choose File > New File > R Script. The Source pane opens with an empty file; save it inside the project.
  3. Run code. Place the cursor on a line in the Source pane and press Ctrl+Enter (Cmd+Enter on a Mac). The line is sent to the Console and its output appears there.
  4. Install a package once. In the Console, type install.packages("ggplot2"). Posit notes you only need to install a package once.
  5. Load it each session. Add library(ggplot2) near the top of your script, because packages are loaded again in every new session.
  6. Check the outputs. Look at the Environment pane for your objects, the Plots pane for figures, and the Help pane for documentation of any function.
  7. Write up in the same place. The Source pane also authors Quarto and R Markdown documents, so analysis and narrative can live in one file.

The workflow that matters for research is the habit rather than the clicks: one project per analysis, every step in a script, and figures generated by code. That is the same discipline CASRAI describes for reproducibility and in the guide on reproducibility infrastructure, workflows, containers and code sharing. Once your data are loaded, how to choose a statistical test and descriptive statistics are natural next steps.

Strengths and limits

Strengths

  • One window combines the editor, console, objects, files, plots and help, as the pane definitions above show.
  • The same interface runs on Windows, macOS and Linux desktops.
  • Projects and scripts support a documented, repeatable analysis, and Quarto and R Markdown can be authored in the Source pane.
  • Open source and commercial editions exist, per Posit’s documentation.

Limits

  • Plots are not stored beyond the session, so figures need to be saved by code.
  • The Environment and History panes are session views, not a record of your analysis; the script is the record.
  • RStudio is an interface for R. It does not decide which statistical method fits your data.

Alternatives

Tool What its own site says
Positron A free IDE purpose-built for data science from Posit, supporting Python, R and SQL, licensed under the source-available Elastic License 2.0
JupyterLab and Jupyter Notebook Web-based environments for notebooks, code and data; Jupyter supports over 40 programming languages, including Python, R, Julia and Scala

Both rows follow each tool’s own site, listed under Sources.

FAQ

Is RStudio the same as R?

No. R is the programming language; RStudio is an integrated development environment for R, which gives you an editor, console and supporting panes.

How do I run code in RStudio?

Put the cursor on a line in the Source pane and press Ctrl+Enter (Cmd+Enter on a Mac), or type a command directly in the Console.

Do I install packages every time?

No. Install a package once with install.packages(), then load it with library() in each new session.

Why did my plot disappear?

The Plots pane holds images generated by code only until the session is restarted. Generate and save figures from a script so you can recreate them.

Sources

Checked 2026-10-29.

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · free to try

Ask about How to Use RStudio: Panes, Projects and Your First Script

Ask your first 2 questions free below. Subscribers get 150 a day for $29 a month.

An AI assistant specialized in research administration. It cites the sources behind every answer, labels web answers and says when it can't answer.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays free to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →

Ask CASRAI · Regulatory Radar

Research-admin question? Get an answer that links its sources.

An AI assistant specialized in research administration. Every answer links its sources to check before you act. 2 questions free, no account. $29/month after.

  • Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.
  • Every answer numbers its sources and links each one, so you can check the source yourself.