# generate the vector of probabilities probability <- rep(1/6, 6) # plot the probabilities plot(probability, xlab = "Outcomes", ylab="Probability", main = "Probability Distribution", pch=20)
This is just not very well-explained imo
For those of your reading (as beginners will surely have trouble understanding the code here)
probability <- rep(1/6,6) meant that we created a vector called probability whose value is given by rep(1/6, 6) which basically means "repeat '1/6' six times", it's the same thing as doing probability <- (1/6, 1/6, 1/6, 1/6, 1/6, 1/6)
Also, pch=20 basically means the value points are represented by filled dots (which is number 20 in the Plotting CHaracteristics parameter)