Editor only — R is not executed here
Online R Editor
Write R with proper highlighting for the assignment arrow, function calls, formulas and pipes, in any browser. Because there is no R session behind the page, nothing is evaluated and no plot appears — the statistics happen in your own environment.
Can you run R here? No — and that is deliberate.
AltF Code edits R; it does not evaluate it. There is no R session, no data frame and no plot device in this page. Run the script in R, RStudio, Positron or a notebook on your own machine.
A browser can execute only HTML, CSS and JavaScript. Everything else on AltF Code is a full editing surface — real highlighting, real editing, real files — and this page says so instead of advertising a compiler that does not exist.
R in the editor
A file named main.r is highlighted with the r grammar — the same grammar Visual Studio Code uses.
nums <- c(3, 1, 4, 1, 5, 9, 2, 6)
cat("mean:", mean(nums), "\n")
cat("sd: ", round(sd(nums), 3), "\n")
df <- data.frame(x = seq_along(nums), y = nums)
summary(df)
What you can do with R here
- Draft an analysis script with correct highlighting for assignment, pipes and function arguments.
- Read an R snippet from a paper, vignette or forum thread on any machine.
- Download a .R file ready for R, RStudio or a notebook cell.
R in this editor — the specifics
| File extension | .r |
|---|---|
| Syntax grammar | Monaco "r" — bundled, no download |
| Code intelligence | Syntax highlighting, bracket matching, comment toggling and word-based suggestions — no type checking |
| Runs in this page | No — editing and highlighting only |
| Run it locally with | Rscript main.R |
| Cost / account | Free, no sign-up; files stay in your browser |
R editor — common questions
- Can I run R code and see plots?
- No. There is no R session and no graphics device in the browser, so nothing is evaluated and no plot is produced. Use R, RStudio, Positron or a hosted notebook for that.
- Can I install packages like ggplot2 here?
- No — package installation needs a real R environment. The editor highlights code that uses any package, but it does not resolve or install them.
- Is it free and private?
- Yes. Free, no account, and nothing uploaded — including whatever data paths your script references.
- What is it useful for?
- Writing, reading and sharing R code from any machine, and drafting a script before you paste it into a session that actually has your data loaded.
Start writing R
The editor opens with a blank file and a cursor. Nothing to install, nothing to sign up for, and your work is saved in your own browser.
Open AltF Code