Practice R online

A free R editor that runs real R 4.6 in your browser. Write code, press Run, and see the output and your plots under it. R's built-in data sets, like mtcars and airquality, are there to explore. There's nothing to install and no account to make.

R 4.6 · free · no sign-up · runs in your browser

console
$ press run to start your program
the first run downloads R (15 MB), then your browser keeps it
// practice problems

R practice problems for beginners

Each one opens in the editor above as a working program with something left for you to finish.

  1. problem 1

    Class scores

    Find the class average, the top score, and how many passed with 60 or more, all without a loop.

  2. problem 2

    FizzBuzz

    Print 1 to 30, but Fizz for multiples of 3, Buzz for multiples of 5, and FizzBuzz for both.

  3. problem 3

    Celsius to Fahrenheit

    Write a function that turns Celsius into Fahrenheit, then use it on a whole vector of temperatures.

  4. problem 4

    Which cars go furthest?

    mtcars is a data set of 32 cars. Print the 5 cars that go the most miles per gallon, best first.

  5. problem 5

    Plot it

    Draw a bar chart of how many cars have 4, 6 and 8 cylinders, with a title and labels.

// what it can do

A free online R compiler that runs in your browser

  • Real R 4.6, with base R, stats and the built-in data sets
  • Plots from plot(), hist(), barplot() and boxplot() show under the console
  • Errors and warnings say which line they're on
  • Every run starts fresh, so nothing from the last run gets in the way
  • Your code is remembered in your browser, and Share gives you a link
  • The free R course in Courses teaches it from the first vector
// questions

R editor questions

Is this R editor free?

Yes. It's free, with no sign-up, no ads and no tracking. Your code runs in your own browser and isn't sent anywhere unless you press Share to make a link.

Which version of R is it?

R 4.6, compiled to WebAssembly by the webR project (webr.r-wasm.org), with base R, the stats, graphics and utils packages, and all of R's built-in data sets. webR is free software under the GPL; its source is at github.com/r-wasm/webr.

Can I install packages like dplyr or ggplot2?

Not here: the editor runs base R only, with nothing downloaded from CRAN. Base R covers a lot, and it's what the R course teaches: vectors, data frames, apply, aggregate, statistics, linear models and plots.

Does readline() work?

No. Programs here run the way Rscript runs a file, so readline() gives back an empty answer straight away. Put the values in your code instead, or in a vector of test cases.

Does it work on a Chromebook, iPad or phone?

Yes, in any up-to-date browser: Chrome, Safari, Edge or Firefox, including school Chromebooks. The first run downloads about 15 MB, then your browser keeps it, so later visits start fast.

Is my code saved?

Your code is remembered in your browser, so it's there when you come back on the same device. To keep a copy or send it to someone, press Share for a link, or Copy.

Are there any limits?

A program can run for 10 seconds (time spent waiting for you to type doesn't count), and programs can be up to 20,000 characters. That's plenty for practice problems, school assignments and small projects.

Want a coach while you practice?

HopeCoders teaches R 1-on-1 for all ages, from first programs to school projects. Every coach is background checked, and sessions happen in person across Greater Los Angeles, from Pasadena, Burbank and Beverly Hills to the South Bay, Long Beach and north Orange County, or online over Zoom.