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 > > visualize <- FALSE # TRUE for manual tests with visualization of results > > data(smokedfish) > fitsf <- fitdistcens(smokedfish,"lnorm") > plot(fitsf) > ppcompcens(fitsf) > ppcompcens(fitsf, fillrect = NA) > ppcompcens(fitsf, fitcol = "black") > ppcompcens(fitsf, fitcol = "black", fillrect = NA) > ppcompcens(fitsf, ylim = c(0.4,1)) Warning message: In ppcompcens(fitsf, ylim = c(0.4, 1)) : By default the same limits are applied to x and y axes. You should specifiy both if you want different x and y limits > ppcompcens(fitsf, xlim = c(0.4,1)) Warning message: In ppcompcens(fitsf, xlim = c(0.4, 1)) : By default the same limits are applied to x and y axes. You should specifiy both if you want different x and y limits > ppcompcens(fitsf, xlim = c(0.4,1), ylim = c(0,1)) > ppcompcens(fitsf, xlim = c(0.5,0.99), xlogscale = TRUE) Warning messages: 1: In ppcompcens(fitsf, xlim = c(0.5, 0.99), xlogscale = TRUE) : As a Q-Q plot should use the same scale on x and y axes, both axes were put in a logarithmic scale. 2: In ppcompcens(fitsf, xlim = c(0.5, 0.99), xlogscale = TRUE) : By default the same limits are applied to x and y axes. You should specifiy both if you want different x and y limits > try(ppcompcens(fitsf, xlogscale = TRUE)) Error in ppcompcens(fitsf, xlogscale = TRUE) : You must define the limits of axes using xlim or ylim in order to use a logarithmic scale for a P-P plot with censored data. In addition: Warning message: In ppcompcens(fitsf, xlogscale = TRUE) : As a Q-Q plot should use the same scale on x and y axes, both axes were put in a logarithmic scale. > > if (requireNamespace("ggplot2", quietly = TRUE)) { + ppcompcens(fitsf, plotstyle = "ggplot") + } > if (requireNamespace("ggplot2", quietly = TRUE) & visualize) { + ppcompcens(fitsf, fillrect = NA, plotstyle = "ggplot") + ppcompcens(fitsf, fitcol = "black", plotstyle = "ggplot") + ppcompcens(fitsf, fitcol = "black", fillrect = NA, plotstyle = "ggplot") + ppcompcens(fitsf, ylim = c(0.4,1), plotstyle = "ggplot") + ppcompcens(fitsf, xlim = c(0.4,1), plotstyle = "ggplot") + ppcompcens(fitsf, xlim = c(0.4,1), ylim = c(0,1), plotstyle = "ggplot") + ppcompcens(fitsf, xlim = c(0.5,0.99), xlogscale = TRUE, plotstyle = "ggplot") + } > > if (visualize) + { + data(fluazinam) + log10EC50 <-log10(fluazinam) + fln <- fitdistcens(log10EC50,"norm") + plot(fln) + if (requireNamespace("ggplot2", quietly = TRUE)) { + ppcompcens(fln, plotstyle = "ggplot") + } + } > > data(salinity) > log10LC50 <-log10(salinity) > fn <- fitdistcens(log10LC50,"norm") > fl <- fitdistcens(log10LC50,"logis") > ppcompcens(list(fn, fl)) > ppcompcens(list(fn, fl), fitlwd = c(5, 2)) > > if (visualize) + { + plotdistcens(log10LC50) + plotdistcens(log10LC50, NPMLE = FALSE) + plot(fn) + plot(fl) + ppcompcens(fn) + ppcompcens(fl) + ppcompcens(list(fn, fl), ynoise = FALSE) + ppcompcens(list(fn, fl), xlogscale = TRUE, xlim = c(0.01, 0.6)) + } > > if (requireNamespace ("ggplot2", quietly = TRUE) ) { + ppcompcens(list(fn, fl), plotstyle = "ggplot", fitcol = "red") + ppcompcens(list(fn, fl), plotstyle = "ggplot", fitlwd = c(5, 2)) + } > > > if (requireNamespace ("ggplot2", quietly = TRUE) & visualize) { + ppcompcens(fn, plotstyle = "ggplot") + ppcompcens(fl, plotstyle = "ggplot") + ppcompcens(list(fn, fl), plotstyle = "ggplot", fitcol = "red") + ppcompcens(list(fn, fl), ynoise = FALSE, plotstyle = "ggplot") + ppcompcens(list(fn, fl), xlogscale = TRUE, xlim = c(0.01, 0.6), plotstyle = "ggplot") + } > > proc.time() user system elapsed 2.96 0.37 3.32