First, create a data frame of the probability distribution. We will use Table 1 from Section 6.1.

Table1 <- data.frame("x" = c(0,1,2,3), "Prob" = c(.01,.1,.38,.51))
Table1
##   x Prob
## 1 0 0.01
## 2 1 0.10
## 3 2 0.38
## 4 3 0.51

Now use the plot command to draw a graph of the probability distribution. In the command, type = h draws vertical lines.

plot(Table1$x, Table1$Prob, type = "h", main = "Shooting Three Free Throws", xlab = "Number of Successful Free Throws", ylab = "Probability", col = '#6897bb')