R Playground

A free online R playground: write and run any R code in your browser, no install or sign-up. Powered by webR. Your sandbox for experimenting with R.

Your sandbox. Type any R code below and press Run Code — it runs entirely in your browser, nothing is uploaded. The first run loads R (a few seconds).

Need a fresh cell? Use this second console for anything else:

NoteWhat can it do?

This is real R — base functions, built-in datasets (mtcars, iris, …), plotting, and many packages. Some large packages aren’t available in the browser build, but everything in these tutorials works. You can also load real biostatistics datasets — see the section below.

Biostatistics datasets to explore

R and its packages ship with a treasure trove of real clinical datasets — great for practising a method with no download or cleaning. Our post Biostatistics datasets built into R tours them; here you can run them.

Run this cell first — it fetches a few packages into your browser (takes a few seconds the first time):

survival::pbc — the Mayo Clinic primary biliary cirrhosis trial. A Kaplan–Meier plot by sex:

MASS::birthwt — low birth weight vs maternal smoking (a logistic-regression classic):

medicaldata::strep_tb — the 1948 streptomycin trial, often called the first modern randomised controlled trial:

Base datasets (no package needed) — infert (matched case-control) and esoph (case-control):


Want structured lessons? Start with R basics. Want R-accurate calculators without writing code? See the free tools.