I need help with this issue.
When I plot out this exponential distribution of this code:
curve(dexp(x, rate = 0.8), col = 2, lty = 2, lwd = 2, add = TRUE)
You could draw a blank density histogram on top of the regular one and consequently add the curve:
hist(y, border = "black") par(new = TRUE) # allows us to draw new plot on top of first one hist(y, probability = TRUE, axes = FALSE, border = "white", xlab = "", ylab = "", main = "") curve(dexp(x, rate = 0.8), col = 2, lty = 2, lwd = 2, add = TRUE)
Note that the plot looks different because of the randomness in