R Under development (unstable) (2024-07-10 r86888 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(fitdistrplus) Loading required package: MASS Loading required package: survival > nsample <- 10 > > # (1) Plot of an empirical distribution with changing > # of default line types for CDF and colors > # and optionally adding a density line > # > set.seed(1234) > x1 <- rnorm(n=nsample) > plotdist(x1) > plotdist(x1, col="blue", type="b", pch=16) Warning messages: 1: In plot.window(xlim, ylim, "", ...) : graphical parameter "type" is obsolete 2: In title(main = main, sub = sub, xlab = xlab, ylab = ylab, ...) : graphical parameter "type" is obsolete 3: In axis(1, ...) : graphical parameter "type" is obsolete 4: In axis(2, at = yt, ...) : graphical parameter "type" is obsolete > plotdist(x1, type="s") Warning messages: 1: In plot.window(xlim, ylim, "", ...) : graphical parameter "type" is obsolete 2: In title(main = main, sub = sub, xlab = xlab, ylab = ylab, ...) : graphical parameter "type" is obsolete 3: In axis(1, ...) : graphical parameter "type" is obsolete 4: In axis(2, at = yt, ...) : graphical parameter "type" is obsolete > plotdist(x1, demp = TRUE) > plotdist(x1, demp = TRUE, adjust = 1.5) Warning messages: 1: In plot.window(xlim, ylim, "", ...) : "adjust" is not a graphical parameter 2: In title(main = main, sub = sub, xlab = xlab, ylab = ylab, ...) : "adjust" is not a graphical parameter 3: In axis(1, ...) : "adjust" is not a graphical parameter 4: In axis(2, at = yt, ...) : "adjust" is not a graphical parameter 5: In plot.window(...) : "adjust" is not a graphical parameter 6: In plot.xy(xy, type, ...) : "adjust" is not a graphical parameter 7: In axis(side = side, at = at, labels = labels, ...) : "adjust" is not a graphical parameter 8: In axis(side = side, at = at, labels = labels, ...) : "adjust" is not a graphical parameter 9: In box(...) : "adjust" is not a graphical parameter 10: In title(...) : "adjust" is not a graphical parameter > plotdist(x1, breaks = 2) > plotdist(x1, breaks = seq(-3, 2)) > > # (2) Plot of a discrete distribution against data > # > set.seed(1234) > x2 <- rpois(n=nsample, lambda = 2) > plotdist(x2, discrete=TRUE) > plotdist(x2, "pois", para=list(lambda = mean(x2))) > plotdist(x2, "pois", para=list(lambda = mean(x2)), lwd="2") > > # (3) Plot of a continuous distribution against data > # > xn <- rnorm(n=nsample, mean=10, sd=5) > plotdist(xn, "norm", para=list(mean=mean(xn), sd=sd(xn))) > plotdist(xn, "norm", para=list(mean=mean(xn), sd=sd(xn)), pch=16) > plotdist(xn, "norm", para=list(mean=mean(xn), sd=sd(xn)), pch=16, + demp = TRUE) > > # (4) Plot of serving size data > # > data(groundbeef) > plotdist(groundbeef$serving, type="s") Warning messages: 1: In plot.window(xlim, ylim, "", ...) : graphical parameter "type" is obsolete 2: In title(main = main, sub = sub, xlab = xlab, ylab = ylab, ...) : graphical parameter "type" is obsolete 3: In axis(1, ...) : graphical parameter "type" is obsolete 4: In axis(2, at = yt, ...) : graphical parameter "type" is obsolete > > # (5) Plot of numbers of parasites with a Poisson distribution > data(toxocara) > number <- toxocara$number > plotdist(number, discrete = TRUE) > plotdist(number,"pois",para=list(lambda=mean(number))) > > > proc.time() user system elapsed 1.57 0.31 1.89