#Estimates a gamma distribution with 1000 sample points using the density() function
# and converts it to a pdfe object for advanced visual analysis.
sampleSize = 1000
sample = rgamma(sampleSize, shape = 1)
kde = density(sample)
kdeTOpdfe = convertToPDFe(sample, kde$x, kde$y)
plot(kdeTOpdfe, plotPDF = FALSE, plotSQR = TRUE, plotShading = TRUE, showOutlierPercent = 95)
Run the code above in your browser using DataLab