x <- rtnorm(1e5, 5, 3, b = 7)
xx <- seq(-10, 10, by = 0.001)
hist(x, 100, freq = FALSE)
lines(xx, dtnorm(xx, 5, 3, b = 7), col = "red")
hist(ptnorm(x, 5, 3, b = 7))
plot(ecdf(x))
lines(xx, ptnorm(xx, 5, 3, b = 7), col = "red", lwd = 2)
Run the code above in your browser using DataLab