R Console and Script Runner

A browser R console and script editor powered by webR: run lines or whole scripts, draw plots, install packages, import CSV data and keep scripts locally.

Draait in je browser. Je bestanden verlaten je apparaat nooit. Zie hoe je dit controleert

…

Zo doe je het

  1. 1
    Start R

    Press Start R and wait for the version line in the console.

  2. 2
    Write or open a script

    Use the editor, + Script or Open .R.

  3. 3
    Run code

    Press Run script, or Ctrl+Enter for the current line or selection.

  4. 4
    Import data

    Click Import data and pick a CSV; the read code runs for you.

  5. 5
    Install packages

    Open Packages, type names such as dplyr and press Install.

  6. 6
    Save results

    Download plots as PNG, output files from Files, and the transcript.

Over deze tool

R is the language of statistics teaching and much of applied data analysis, but installing R and RStudio is a hurdle on school computers, tablets and borrowed laptops. webR is the official build of R for WebAssembly, maintained by the R Consortium project at Posit, and this page wraps it in a familiar layout: a script editor on the left, an environment, files and packages panel on the right, and a console underneath. Run the whole script, the current line or a selection with keyboard shortcuts as in RStudio, or type commands at the prompt with history on the arrow keys. Base graphics and ggplot2 plots appear in the console and can be downloaded as PNG. Packages install from the webR binary repository, CSV, TSV and RDS files import into the session with one click, and files your code writes can be downloaded. Scripts and the package list are saved in your browser.

Who this is for

Statistics students and teachers, researchers who need R on a machine without admin rights, data journalists checking a number quickly, and anyone learning R who wants to try code without installing anything.

Starting R

Press Start R. The page explains what is downloaded (about 25 MB from webr.r-wasm.org, cached afterwards) and then prints the R version. Once started, the session starts automatically the next time you open the page.

Script editor

Keep several scripts with names. Ctrl+Enter runs the current line or the selection and moves to the next line; Ctrl+Shift+Enter runs the whole script. Tab inserts two spaces. Open and save .R files from your computer.

Console

Type a command and press Enter; up and down arrows walk through history. Output, warnings and errors appear in different colours. Save transcript downloads the session as text, Copy puts it on the clipboard.

Environment, files and packages

The environment table lists every object with its class, dimensions and memory size; click one to run str() on it. Files shows the working directory with download buttons, so write.csv, saveRDS or png output can be saved. Packages installs by name from repo.r-wasm.org, which hosts most CRAN packages that do not need system libraries, and remembers the list for the next session.

Data import

Import data copies CSV, TSV, TXT, RDS, RData, JSON and XLSX files into the session and writes the matching read code, for example sales <- read.csv("sales.csv") followed by str(sales). JSON and Excel need jsonlite or readxl installed first.

Plots

Plots are captured at the size you choose (default 640 × 420 pixels) and shown inline with a Download PNG button.

Worked example

The first sample script fits lm(mpg ~ wt) on the built-in mtcars data. The coefficients are 37.29 for the intercept and −5.34 for weight, meaning each extra 1,000 lbs costs about 5.3 miles per gallon, and the plot shows the falling regression line through the 32 cars.

Limits

webR runs R in a single browser tab, so very large data sets and long simulations are slower than desktop R and limited by memory. Packages with compiled system dependencies may be missing from the webR repository. Interactive input such as readline() and Shiny apps are not supported here, and the session is reset when you close the tab, although scripts stay saved.

Uitgewerkt voorbeeld

lm(mpg ~ wt, data = mtcars): intercept 37.29, slope −5.34 per 1,000 lbs; the plot shows the fitted line.

In het kort

Veelgestelde vragen

Is this real R?

Yes. webR is R 4.4 compiled to WebAssembly, so base R and most CRAN packages behave as on the desktop.

Can I install ggplot2 or dplyr?

Yes. Type the names in Packages and press Install; they come from the webR repository and are cached by the browser.

Is my data uploaded?

No. Imported files are copied into R's virtual file system inside your browser.

Why is the first start slow?

The R runtime is about 25 MB. After the first download the browser cache makes later starts much faster.

How do I save my work?

Scripts are saved automatically in local storage; use Save .R or Save file for a copy, and download output files from the Files tab.

Can I run Shiny apps?

Not in this console. Shiny needs a different setup (Shinylive); here plots are static images.

Helemaal gratisGeen kosten, geen registratie
Bestanden blijven privéAlles draait in je browser
Makkelijk in je eigen taalBeschikbaar in veel talen