How can I plot a chi-square density graph in R?
I got the following codes but I'm not sure how to manipulate them:
curve( dchisq(x, df=28), col='red', main = "Chi-Square Density Graph",
from=0,to=60)
xvec <- seq(7.5,60,length=101)
pvec <- dchisq(xvec,df=28)
polygon(c(xvec,rev(xvec)),c(pvec,rep(0,length(pvec))),
col=adjustcolor("black",alpha=0.3))
Could someone explain what the codes mean?