Online R Script Compiler
Run R scripts online: paste your R script, press Run, and it is executed with Rscript on R 4.5. Results printed with print() and cat() appear in the output panel as the script runs.
How to run R code online
- This page opens with R selected, so you can start typing straight away.
- Write your code in the editor, or open files from your computer: single files, or a whole project as a .zip.
- Press Run, or Ctrl+Enter. The output appears in the panel beside the editor, and when the program asks for input you type it there and press Enter.
- Share a copy with a link, or save your files to your computer.
R 4.5 (Rscript) on Online IDE
- Scripts run with Rscript, the same way you would run them from a terminal.
- Rscript is not interactive, so read input with readLines(file("stdin"), n = 1) instead of readline().
- Results you print with print() or cat() appear in the output panel straight away.
Example: a R program that reads input
scores <- c(72, 85, 90, 64, 78)
cat("Mean:", mean(scores), "\n")
cat("Median:", median(scores), "\n")
cat("Highest:", max(scores), "\n")
print(summary(scores))
Features of this tool
- Simple and fastA clean, lightweight editor that opens instantly.
- Powered by AceThe Ace code editor, with syntax highlighting, autocompletion and bracket matching.
- Interactive programsType input into the terminal while your program runs.
- Several filesWork in tabs, open files or a .zip from your computer, and save the project back to disk.
- Made for learningHelpful for beginners to learn and practice programs.
- Light and dark themesPlus 39 editor themes, a choice of coding fonts, and Vim, Emacs or VS Code keys.
- Keep your outputCopy or download the program output in one click.
- Share by linkSave your code in the cloud and open it anywhere.
Frequently asked questions
Which R version does Online IDE run?
R 4.5, run with Rscript on Linux.
Why does readline() not wait for my input?
readline() only waits in an interactive R session, and Rscript is not interactive. Use readLines(file("stdin"), n = 1) to read a line you type in the output panel.
Is this the same as an online RScript compiler?
Yes. R is interpreted rather than compiled, and every script here runs with Rscript, so you get the same result as running Rscript main.r on your own computer.
More R tools
Contact us
For any feedback, queries or issues, please feel free to contact us or write to . We value your input and are committed to providing the best possible experience for our users.