options(scipen=999)
options(digits=9)
cat("\014") # clear screen
rm(list=ls(all=TRUE))


x=seq(from=0,to=10,by=0.001)
plot(x,dgamma(x,1),
     xlim=c(0,10),
     ylim=c(0,1),
     lwd=2,
     type="l",axes=TRUE,
     col="red",
     tck=0.05,
     xaxs="i",yaxs="i",
     col.sub="Black",
     col.main="Green",
     xlab="x",
     ylab="f(x)",
     main="Gamma Distribution",
     sub="R(a=1,b=1) B(a=2,b=1) G(a=3,b=1) black(a=4,b=1)")
lines(x,dgamma(x,2),type="l",col="blue")
lines(x,dgamma(x,3),type="l",col="green")
lines(x,dgamma(x,4),type="l",col="black")


dgamma(x, shape, rate = 1, scale = 1/rate, log = FALSE)