6. Plotting

Render R base graphics like hist() and plot() live in your browser with editable code.

Rโ€™s base graphics work here too โ€” call plot(), hist(), or similar, and the image renders right below your code.

Discuss first

Before you run the code below: x is 500 draws from a normal distribution with mean = 100. What shape do you expect the histogram to have, and roughly where should it be centered?

Edit the code below if you like, then press Run Code to check your answer.

Check your understanding

Q1. Which function draws a histogram of a numeric vector?

Q2. Fill in the blank: the function used to draw random values from a normal distribution is:

(500, mean = 100, sd = 15)
Back to top