What you can do here
- Run R with plots: base graphics and ggplot2 charts appear under your code, ready to download.
- Use CRAN packages: call
library(dplyr)orlibrary(ggplot2)and the package is installed for you the first time. - Load sample data in one click, or upload your own CSV. R's built-in datasets such as
irisandmtcarswork too. - See your variables: the Variables tab lists every object with its class and size, like the Environment pane in RStudio.
- Notebook cells: split the code with
# %%, run one cell with Shift + Enter, and export as a Jupyter notebook. - Plain-English errors for the most common R messages, and share links that hold your code.
How it works
R runs in your browser using webR, R compiled to WebAssembly. The first run downloads it (about 20 MB, plus any packages you load) and your browser keeps it. Your code and data stay on your device.
Limits
Packages must be built for webR (most popular CRAN packages are). readline() cannot wait for typing in the browser, and code cannot reach the internet. Stop restarts R, which clears your variables.
Examples
| Example | What it shows |
|---|---|
| Hello, R | Vectors, a function and paste(). |
| Average order value by country | merge() and aggregate() in base R. |
| Join orders to customers | merge() joins two data frames on a key. |
| Top 5 products by revenue | aggregate, sort, head. |
| Finding and handling missing values | is.na(), colSums() and filling with the median. |
| Monthly revenue chart | A base-R bar chart. |
| A ggplot2 chart | ggplot2 installs automatically the first time (it takes a moment). |
| Predict house prices | A linear model with lm() and its summary. |
| Do SMS reminders matter? | A two-sample comparison: t.test() and a proportion test. |
| Cluster flowers with k-means | R's built-in iris data, kmeans() and a plot. |
| Running total per customer | cumsum() within groups using ave(). |
| Notebook mode: cells | Lines starting with # %% split the code into cells; Shift+Enter runs one cell. |
Learn more
Comparing languages? Most examples here have the same task in Python and SQL: use "Same task in" under the editor.
Questions
Is this R compiler free?
Yes, with no sign-up. R runs in your browser through webR.
Does ggplot2 work online?
Yes. The first library(ggplot2) installs it, which takes a little while; after that it loads quickly.
Which R version is it?
webR 0.5, which runs R 4.5.
Can I install other packages?
Most popular CRAN packages are built for webR and install when you call library().