A most simple example
x11()
set.seed(280872)
values <- c(rnorm(10000, 50, 30),
rnorm( 5000,110, 15))
hist(values)
# wait for mouse click or enter pressed
z <- locator(1)
Adding bins to the histogram
The above example only shows 10 bins. This might be too little to reveal the underlying distribution of the data.
The second argument to hist
allows to specify the numbers of bins drawn:
x11()
set.seed(280872)
values <- c(rnorm(10000, 50, 30),
rnorm( 5000,110, 15))
# Note the 2nd argument to specify the number of bins
hist(values, 40)
# wait for mouse click or enter pressed
z <- locator(1)