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
- 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.
- Create a script. Choose File > New File > R Script. The Source pane opens with an empty file; save it inside the project.
- 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.
- Install a package once. In the Console, type
install.packages("ggplot2"). Posit notes you only need to install a package once. - Load it each session. Add
library(ggplot2)near the top of your script, because packages are loaded again in every new session. - 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.
- 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.
- Posit, RStudio IDE user guide: panes
- Posit, RStudio IDE user guide: get started
- Posit, RStudio IDE user guide
- Posit Education, Hands-On Programming with R, Appendix A
- Posit, Positron
- Project Jupyter, jupyter.org








