diff --git a/R/descdist.R b/R/descdist.R index 37106f6e..b1bec9b7 100644 --- a/R/descdist.R +++ b/R/descdist.R @@ -9,7 +9,7 @@ # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the @@ -132,15 +132,14 @@ descdist <- function(data, discrete = FALSE, boot = NULL, method = "unbiased", shape<-exp(lshape) s2<-4/shape y<-kurtmax-(3+6/shape) - lines(s2,y,lty=2) + lines(s2,y,lty=2, xlim=c(0,xmax),ylim=c(0,ymax)) # lnorm dist lshape<-seq(-100,100,0.1) shape<-exp(lshape) es2<-exp(shape^2) s2<-(es2+2)^2*(es2-1) y<-kurtmax-(es2^4+2*es2^3+3*es2^2-3) - lines(s2,y,lty=3) - + lines(s2,y,lty=3,xlim=c(0,xmax),ylim=c(0,ymax)) legend(xmax*0.55, ymax*1.03,legend="Theoretical",bty="n",cex=0.8) legend(xmax*0.6, ymax*0.98,pch=8,legend="normal",bty="n",cex=0.8) @@ -190,7 +189,7 @@ descdist <- function(data, discrete = FALSE, boot = NULL, method = "unbiased", lambda<-exp(llambda) s2<-1/lambda y<-kurtmax-(3+1/lambda) - lines(s2,y,lty=2) + lines(s2,y,lty=2, xlim=c(0,xmax),ylim=c(0,ymax)) } # bootstrap sample for observed distribution if (!is.null(boot)) { diff --git a/man/descdist.Rd b/man/descdist.Rd index fe01589f..92271e9d 100644 --- a/man/descdist.Rd +++ b/man/descdist.Rd @@ -101,33 +101,33 @@ Marie-Laure Delignette-Muller and Christophe Dutang. # set.seed(1234) x1 <- rnorm(100) -# descdist(x1) -# descdist(x1,boot=11) +descdist(x1) +descdist(x1,boot=11) # (2) Description of a sample from a beta distribution # with uncertainty on skewness and kurtosis estimated by bootstrap # with changing of default colors and plotting character for observed point # -# descdist(rbeta(100,shape1=0.05,shape2=1),boot=11, -# obs.col="blue", obs.pch = 15, boot.col="darkgreen") +descdist(rbeta(100,shape1=0.05,shape2=1),boot=11, + obs.col="blue", obs.pch = 15, boot.col="darkgreen") # (3) Description of a sample from a gamma distribution # with uncertainty on skewness and kurtosis estimated by bootstrap # without plotting # -# descdist(rgamma(100,shape=2,rate=1),boot=11,graph=FALSE) +descdist(rgamma(100,shape=2,rate=1),boot=11,graph=FALSE) # (4) Description of a sample from a Poisson distribution # with uncertainty on skewness and kurtosis estimated by bootstrap # -# descdist(rpois(100,lambda=2),discrete=TRUE,boot=11) +descdist(rpois(100,lambda=2),discrete=TRUE,boot=11) # (5) Description of serving size data # with uncertainty on skewness and kurtosis estimated by bootstrap # -# data(groundbeef) -# serving <- groundbeef$serving -# descdist(serving, boot=11) +data(groundbeef) +serving <- groundbeef$serving +descdist(serving, boot=11) } \keyword{ distribution } diff --git a/man/endosulfan.Rd b/man/endosulfan.Rd index e18d1549..7549c64c 100644 --- a/man/endosulfan.Rd +++ b/man/endosulfan.Rd @@ -36,7 +36,7 @@ data(endosulfan) # log10ATV <-log10(subset(endosulfan,(Australian == "no") & (group == "Fish"))$ATV) plotdist(log10ATV) -# descdist(log10ATV,boot=11) +descdist(log10ATV,boot=11) # (3) fit of a normal and a logistic distribution to data in log10 # (classical distributions used for SSD) diff --git a/man/groundbeef.Rd b/man/groundbeef.Rd index 1517c984..48bf8aa4 100644 --- a/man/groundbeef.Rd +++ b/man/groundbeef.Rd @@ -23,7 +23,7 @@ data(groundbeef) # (2) description and plot of data # serving <- groundbeef$serving -# descdist(serving) +descdist(serving) plotdist(serving) # (3) fit of a Weibull distribution to data diff --git a/man/toxocara.Rd b/man/toxocara.Rd index acac2bf4..66122b1f 100644 --- a/man/toxocara.Rd +++ b/man/toxocara.Rd @@ -22,7 +22,7 @@ data(toxocara) # (2) description and plot of data # number <- toxocara$number -# descdist(number, discrete = TRUE, boot = 11) +descdist(number, discrete = TRUE, boot = 11) plotdist(number, discrete = TRUE) # (3) fit of a Poisson distribution to data