From noreply at r-forge.r-project.org Fri Jan 15 17:10:19 2016 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 15 Jan 2016 17:10:19 +0100 (CET) Subject: [Distr-commits] r1080 - branches/distr-2.7/pkg/distr/R branches/distr-2.7/pkg/distr/inst pkg/distr/R pkg/distr/inst Message-ID: <20160115161019.735201853F5@r-forge.r-project.org> Author: ruckdeschel Date: 2016-01-15 17:10:19 +0100 (Fri, 15 Jan 2016) New Revision: 1080 Modified: branches/distr-2.7/pkg/distr/R/plot-methods_LebDec.R branches/distr-2.7/pkg/distr/inst/NEWS pkg/distr/R/plot-methods_LebDec.R pkg/distr/inst/NEWS Log: distr: - bug fixes: + fixed a bug in plot (q) for LebDec-Distributions (verticals were not plotted correctly) + panel selection mechanism had a bug for LebDec-Distributions Modified: branches/distr-2.7/pkg/distr/R/plot-methods_LebDec.R =================================================================== --- branches/distr-2.7/pkg/distr/R/plot-methods_LebDec.R 2015-12-16 19:15:29 UTC (rev 1079) +++ branches/distr-2.7/pkg/distr/R/plot-methods_LebDec.R 2016-01-15 16:10:19 UTC (rev 1080) @@ -79,8 +79,9 @@ mcl <- as.list(mc) mcl$to.draw.arg <- (1:3)[( (6:8) %in%to.draw )] mcl$ngrid <- NULL - mcl$panel.first <- pF[plotCount+(0:2)] - mcl$panel.last <- pL[plotCount+(0:2)] + whichPFL <- mcl$to.draw.arg + mcl$panel.first <- pF[whichPFL] + mcl$panel.last <- pL[whichPFL] if(is.null(mcl$xlab)) mcl$xlab <- xlab0.d if(is.null(mcl$ylab)) mcl$ylab <- ylab0.d if(!is.logical(inner)){ @@ -97,9 +98,10 @@ mcl$col.hor <- NULL if(is.null(mcl$xlab)) mcl$xlab <- xlab0.c if(is.null(mcl$ylab)) mcl$ylab <- ylab0.c - mcl$panel.first <- pF[plotCount+(0:2)] - mcl$panel.last <- pL[plotCount+(0:2)] mcl$to.draw.arg <- (1:3)[( (3:5) %in%to.draw )] + whichPFL <- mcl$to.draw.arg + mcl$panel.first <- pF[whichPFL] + mcl$panel.last <- pL[whichPFL] if(!is.logical(inner)){ if(length(inner)!=3) {inner <- .fillList(inner, 8) @@ -118,8 +120,9 @@ mcl$x <- x mcl$to.draw.arg <- (1:3)[( (6:8) %in%to.draw )] mcl$ngrid <- NULL - mcl$panel.first <- pF[5+mcl$to.draw.arg] - mcl$panel.last <- pL[5+mcl$to.draw.arg] + whichPFL <- if(l.draw<8) mcl$to.draw.arg else 5+mcl$to.draw.arg + mcl$panel.first <- pF[whichPFL] + mcl$panel.last <- pL[whichPFL] if(!is.logical(inner)){ if(length(inner)!=3) {inner <- .fillList(inner, 8) @@ -137,8 +140,9 @@ mcl$x <- x mcl$to.draw.arg <- (1:3)[( (3:5) %in%to.draw )] mcl$col.hor <- NULL - mcl$panel.first <- pF[2+mcl$to.draw.arg] - mcl$panel.last <- pL[2+mcl$to.draw.arg] + whichPFL <- if(l.draw<8) mcl$to.draw.arg else 2+mcl$to.draw.arg + mcl$panel.first <- pF[whichPFL] + mcl$panel.last <- pL[whichPFL] if(!is.logical(inner)){ if(length(inner)!=3) {inner <- .fillList(inner, 8) @@ -219,7 +223,7 @@ qparamstring, as.character(deparse(xc)))) }else function(inx)inx - + .mp2 <- function(dlb = dots$xlab, lb0 = list(list("p"="q", "q"="p"), list("d"="x", "p"="q", "q"="p"), list("d"="x", "p"="q", "q"="p"))){ @@ -241,6 +245,7 @@ if(length(res)==0) return(NULL) if(is.na(res)) return(NULL) return(res)} + iL <- 1:length(to.draw) force(lb0) .mp3 <- .mp(dlb,iL[to.draw==1]) if(1%in%to.draw & !is.null(.mp3)) lb0[[1]][["p"]] <- .mp3 @@ -473,7 +478,7 @@ pu <- c(rep(pu1,3), pxg[i.not.gap]) } # - o <- order(pu,xu) + o <- order(pu) po <- pu[o] xo <- xu[o] }else{ @@ -552,8 +557,11 @@ mc.ac$withSweave <- TRUE mc.ac$to.draw.arg <- (1:3)[( (3:5) %in%to.draw )] if(is.null(mc.ac$cex.inner)) mc.ac$cex.inner <- 0.9 - mc.ac[["panel.first"]] <- pF[plotCount+(0:2)] - mc.ac[["panel.last"]] <- pL[plotCount+(0:2)] + + whichPFL <- plotCount-1+mc.ac$to.draw.arg + mc.ac$panel.first <- pF[whichPFL] + mc.ac$panel.last <- pL[whichPFL] + do.call(plotC, c(list(acPart(x)),mc.ac), envir = parent.frame(2)) plotCount <- plotCount + 3 @@ -573,8 +581,10 @@ mc.di$withSweave <- TRUE mc.di$to.draw.arg <- (1:3)[( (6:8) %in%to.draw )] if(is.null(mc.di$cex.inner)) mc.di$cex.inner <- 0.9 - mc.di[["panel.first"]] <- pF[plotCount+(0:2)] - mc.di[["panel.last"]] <- pL[plotCount+(0:2)] + + whichPFL <- plotCount-1+mc.di$to.draw.arg + mc.di$panel.first <- pF[whichPFL] + mc.di$panel.last <- pL[whichPFL] do.call(plotD, c(list(discretePart(x)),mc.di), envir = parent.frame(2)) plotCount <- plotCount + 3 return(invisible()) Modified: branches/distr-2.7/pkg/distr/inst/NEWS =================================================================== --- branches/distr-2.7/pkg/distr/inst/NEWS 2015-12-16 19:15:29 UTC (rev 1079) +++ branches/distr-2.7/pkg/distr/inst/NEWS 2016-01-15 16:10:19 UTC (rev 1080) @@ -51,6 +51,10 @@ correctly passed on, same for col => now use dots.lowlevel ... -helper function .isReplicated gains an optional argument tol +- bug fixes: + + fixed a bug in plot (q) for LebDec-Distributions (verticals were not plotted correctly) + + panel selection mechanism had a bug for LebDec-Distributions + ############## v 2.5.3 ############## Modified: pkg/distr/R/plot-methods_LebDec.R =================================================================== --- pkg/distr/R/plot-methods_LebDec.R 2015-12-16 19:15:29 UTC (rev 1079) +++ pkg/distr/R/plot-methods_LebDec.R 2016-01-15 16:10:19 UTC (rev 1080) @@ -79,8 +79,9 @@ mcl <- as.list(mc) mcl$to.draw.arg <- (1:3)[( (6:8) %in%to.draw )] mcl$ngrid <- NULL - mcl$panel.first <- pF[plotCount+(0:2)] - mcl$panel.last <- pL[plotCount+(0:2)] + whichPFL <- mcl$to.draw.arg + mcl$panel.first <- pF[whichPFL] + mcl$panel.last <- pL[whichPFL] if(is.null(mcl$xlab)) mcl$xlab <- xlab0.d if(is.null(mcl$ylab)) mcl$ylab <- ylab0.d if(!is.logical(inner)){ @@ -97,9 +98,10 @@ mcl$col.hor <- NULL if(is.null(mcl$xlab)) mcl$xlab <- xlab0.c if(is.null(mcl$ylab)) mcl$ylab <- ylab0.c - mcl$panel.first <- pF[plotCount+(0:2)] - mcl$panel.last <- pL[plotCount+(0:2)] mcl$to.draw.arg <- (1:3)[( (3:5) %in%to.draw )] + whichPFL <- mcl$to.draw.arg + mcl$panel.first <- pF[whichPFL] + mcl$panel.last <- pL[whichPFL] if(!is.logical(inner)){ if(length(inner)!=3) {inner <- .fillList(inner, 8) @@ -118,8 +120,9 @@ mcl$x <- x mcl$to.draw.arg <- (1:3)[( (6:8) %in%to.draw )] mcl$ngrid <- NULL - mcl$panel.first <- pF[5+mcl$to.draw.arg] - mcl$panel.last <- pL[5+mcl$to.draw.arg] + whichPFL <- if(l.draw<8) mcl$to.draw.arg else 5+mcl$to.draw.arg + mcl$panel.first <- pF[whichPFL] + mcl$panel.last <- pL[whichPFL] if(!is.logical(inner)){ if(length(inner)!=3) {inner <- .fillList(inner, 8) @@ -137,8 +140,9 @@ mcl$x <- x mcl$to.draw.arg <- (1:3)[( (3:5) %in%to.draw )] mcl$col.hor <- NULL - mcl$panel.first <- pF[2+mcl$to.draw.arg] - mcl$panel.last <- pL[2+mcl$to.draw.arg] + whichPFL <- if(l.draw<8) mcl$to.draw.arg else 2+mcl$to.draw.arg + mcl$panel.first <- pF[whichPFL] + mcl$panel.last <- pL[whichPFL] if(!is.logical(inner)){ if(length(inner)!=3) {inner <- .fillList(inner, 8) @@ -219,7 +223,7 @@ qparamstring, as.character(deparse(xc)))) }else function(inx)inx - + .mp2 <- function(dlb = dots$xlab, lb0 = list(list("p"="q", "q"="p"), list("d"="x", "p"="q", "q"="p"), list("d"="x", "p"="q", "q"="p"))){ @@ -241,6 +245,7 @@ if(length(res)==0) return(NULL) if(is.na(res)) return(NULL) return(res)} + iL <- 1:length(to.draw) force(lb0) .mp3 <- .mp(dlb,iL[to.draw==1]) if(1%in%to.draw & !is.null(.mp3)) lb0[[1]][["p"]] <- .mp3 @@ -473,7 +478,7 @@ pu <- c(rep(pu1,3), pxg[i.not.gap]) } # - o <- order(pu,xu) + o <- order(pu) po <- pu[o] xo <- xu[o] }else{ @@ -552,8 +557,11 @@ mc.ac$withSweave <- TRUE mc.ac$to.draw.arg <- (1:3)[( (3:5) %in%to.draw )] if(is.null(mc.ac$cex.inner)) mc.ac$cex.inner <- 0.9 - mc.ac[["panel.first"]] <- pF[plotCount+(0:2)] - mc.ac[["panel.last"]] <- pL[plotCount+(0:2)] + + whichPFL <- plotCount-1+mc.ac$to.draw.arg + mc.ac$panel.first <- pF[whichPFL] + mc.ac$panel.last <- pL[whichPFL] + do.call(plotC, c(list(acPart(x)),mc.ac), envir = parent.frame(2)) plotCount <- plotCount + 3 @@ -573,8 +581,10 @@ mc.di$withSweave <- TRUE mc.di$to.draw.arg <- (1:3)[( (6:8) %in%to.draw )] if(is.null(mc.di$cex.inner)) mc.di$cex.inner <- 0.9 - mc.di[["panel.first"]] <- pF[plotCount+(0:2)] - mc.di[["panel.last"]] <- pL[plotCount+(0:2)] + + whichPFL <- plotCount-1+mc.di$to.draw.arg + mc.di$panel.first <- pF[whichPFL] + mc.di$panel.last <- pL[whichPFL] do.call(plotD, c(list(discretePart(x)),mc.di), envir = parent.frame(2)) plotCount <- plotCount + 3 return(invisible()) Modified: pkg/distr/inst/NEWS =================================================================== --- pkg/distr/inst/NEWS 2015-12-16 19:15:29 UTC (rev 1079) +++ pkg/distr/inst/NEWS 2016-01-15 16:10:19 UTC (rev 1080) @@ -22,7 +22,6 @@ + pattern substitution can now be switched on and off in all plot functions according to argument withSubst - under the hood: -qqplot: @@ -51,6 +50,11 @@ correctly passed on, same for col => now use dots.lowlevel ... -helper function .isReplicated gains an optional argument tol +- bug fixes: + + fixed a bug in plot (q) for LebDec-Distributions (verticals were not plotted correctly) + + panel selection mechanism had a bug for LebDec-Distributions + + ############## v 2.5.3 ############## From noreply at r-forge.r-project.org Fri Jan 15 17:36:56 2016 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 15 Jan 2016 17:36:56 +0100 (CET) Subject: [Distr-commits] r1081 - in pkg/distr: R inst Message-ID: <20160115163656.62856187C72@r-forge.r-project.org> Author: ruckdeschel Date: 2016-01-15 17:36:56 +0100 (Fri, 15 Jan 2016) New Revision: 1081 Modified: pkg/distr/R/plot-methods.R pkg/distr/R/plot-methods_LebDec.R pkg/distr/inst/NEWS Log: distr: + fixed axis annotation: if xlab="" or ylab="" the respective lab are "" for all panels Modified: pkg/distr/R/plot-methods.R =================================================================== --- pkg/distr/R/plot-methods.R 2016-01-15 16:10:19 UTC (rev 1080) +++ pkg/distr/R/plot-methods.R 2016-01-15 16:36:56 UTC (rev 1081) @@ -129,6 +129,7 @@ if(is.call(res)) res <- res[-1] return(res)} }else function(x,i){ + if(length(x)==1) return(x[1]) res <- x[i] if(length(res)==0) return(NULL) if(is.na(res)) return(NULL) @@ -495,6 +496,7 @@ if(is.call(res)) res <- res[-1] return(res)} }else function(x,i){ + if(length(x)==1) return(x[1]) res <- x[i] if(length(res)==0) return(NULL) if(is.na(res)) return(NULL) Modified: pkg/distr/R/plot-methods_LebDec.R =================================================================== --- pkg/distr/R/plot-methods_LebDec.R 2016-01-15 16:10:19 UTC (rev 1080) +++ pkg/distr/R/plot-methods_LebDec.R 2016-01-15 16:36:56 UTC (rev 1081) @@ -241,11 +241,15 @@ if(is.call(res)) res <- res[-1] return(res)} }else function(x,i){ + if(length(x)==1) return(x[1]) res <- x[i] if(length(res)==0) return(NULL) if(is.na(res)) return(NULL) return(res)} iL <- 1:length(to.draw) + print(to.draw) + print(iL[to.draw==1]) + print(iL[to.draw==2]) force(lb0) .mp3 <- .mp(dlb,iL[to.draw==1]) if(1%in%to.draw & !is.null(.mp3)) lb0[[1]][["p"]] <- .mp3 @@ -276,8 +280,11 @@ ylab0.c <- xlab0[[2]] ylab0.d <- ylab0[[3]] dots$ylab <- NULL + cat("\n----------------\nx\n--------------\n") + print(xlab0) + cat("\n----------------\ny\n--------------\n") + print(ylab0) - if (hasArg("main")){ mainL <- TRUE if (is.logical(main)){ Modified: pkg/distr/inst/NEWS =================================================================== --- pkg/distr/inst/NEWS 2016-01-15 16:10:19 UTC (rev 1080) +++ pkg/distr/inst/NEWS 2016-01-15 16:36:56 UTC (rev 1081) @@ -53,6 +53,7 @@ - bug fixes: + fixed a bug in plot (q) for LebDec-Distributions (verticals were not plotted correctly) + panel selection mechanism had a bug for LebDec-Distributions + + fixed axis annotation: if xlab="" or ylab="" the respective lab are "" for all panels ############## From noreply at r-forge.r-project.org Fri Jan 15 17:38:52 2016 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 15 Jan 2016 17:38:52 +0100 (CET) Subject: [Distr-commits] r1082 - in branches/distr-2.7/pkg/distr: R inst Message-ID: <20160115163852.C8154187C72@r-forge.r-project.org> Author: ruckdeschel Date: 2016-01-15 17:38:52 +0100 (Fri, 15 Jan 2016) New Revision: 1082 Modified: branches/distr-2.7/pkg/distr/R/plot-methods.R branches/distr-2.7/pkg/distr/R/plot-methods_LebDec.R branches/distr-2.7/pkg/distr/inst/NEWS Log: distr: ported change in trunk to devel Modified: branches/distr-2.7/pkg/distr/R/plot-methods.R =================================================================== --- branches/distr-2.7/pkg/distr/R/plot-methods.R 2016-01-15 16:36:56 UTC (rev 1081) +++ branches/distr-2.7/pkg/distr/R/plot-methods.R 2016-01-15 16:38:52 UTC (rev 1082) @@ -129,6 +129,7 @@ if(is.call(res)) res <- res[-1] return(res)} }else function(x,i){ + if(length(x)==1) return(x[1]) res <- x[i] if(length(res)==0) return(NULL) if(is.na(res)) return(NULL) @@ -495,6 +496,7 @@ if(is.call(res)) res <- res[-1] return(res)} }else function(x,i){ + if(length(x)==1) return(x[1]) res <- x[i] if(length(res)==0) return(NULL) if(is.na(res)) return(NULL) Modified: branches/distr-2.7/pkg/distr/R/plot-methods_LebDec.R =================================================================== --- branches/distr-2.7/pkg/distr/R/plot-methods_LebDec.R 2016-01-15 16:36:56 UTC (rev 1081) +++ branches/distr-2.7/pkg/distr/R/plot-methods_LebDec.R 2016-01-15 16:38:52 UTC (rev 1082) @@ -241,11 +241,15 @@ if(is.call(res)) res <- res[-1] return(res)} }else function(x,i){ + if(length(x)==1) return(x[1]) res <- x[i] if(length(res)==0) return(NULL) if(is.na(res)) return(NULL) return(res)} iL <- 1:length(to.draw) + print(to.draw) + print(iL[to.draw==1]) + print(iL[to.draw==2]) force(lb0) .mp3 <- .mp(dlb,iL[to.draw==1]) if(1%in%to.draw & !is.null(.mp3)) lb0[[1]][["p"]] <- .mp3 @@ -276,8 +280,11 @@ ylab0.c <- xlab0[[2]] ylab0.d <- ylab0[[3]] dots$ylab <- NULL + cat("\n----------------\nx\n--------------\n") + print(xlab0) + cat("\n----------------\ny\n--------------\n") + print(ylab0) - if (hasArg("main")){ mainL <- TRUE if (is.logical(main)){ Modified: branches/distr-2.7/pkg/distr/inst/NEWS =================================================================== --- branches/distr-2.7/pkg/distr/inst/NEWS 2016-01-15 16:36:56 UTC (rev 1081) +++ branches/distr-2.7/pkg/distr/inst/NEWS 2016-01-15 16:38:52 UTC (rev 1082) @@ -54,7 +54,8 @@ - bug fixes: + fixed a bug in plot (q) for LebDec-Distributions (verticals were not plotted correctly) + panel selection mechanism had a bug for LebDec-Distributions - + + fixed axis annotation: if xlab="" or ylab="" the respective lab are "" for all panels + ############## v 2.5.3 ############## From noreply at r-forge.r-project.org Fri Jan 15 17:42:34 2016 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 15 Jan 2016 17:42:34 +0100 (CET) Subject: [Distr-commits] r1083 - branches/distr-2.7/pkg/distr/R pkg/distr/R Message-ID: <20160115164234.C0C9E187C72@r-forge.r-project.org> Author: ruckdeschel Date: 2016-01-15 17:42:34 +0100 (Fri, 15 Jan 2016) New Revision: 1083 Modified: branches/distr-2.7/pkg/distr/R/plot-methods_LebDec.R pkg/distr/R/plot-methods_LebDec.R Log: distr: argh some relics from debugging... Modified: branches/distr-2.7/pkg/distr/R/plot-methods_LebDec.R =================================================================== --- branches/distr-2.7/pkg/distr/R/plot-methods_LebDec.R 2016-01-15 16:38:52 UTC (rev 1082) +++ branches/distr-2.7/pkg/distr/R/plot-methods_LebDec.R 2016-01-15 16:42:34 UTC (rev 1083) @@ -247,9 +247,6 @@ if(is.na(res)) return(NULL) return(res)} iL <- 1:length(to.draw) - print(to.draw) - print(iL[to.draw==1]) - print(iL[to.draw==2]) force(lb0) .mp3 <- .mp(dlb,iL[to.draw==1]) if(1%in%to.draw & !is.null(.mp3)) lb0[[1]][["p"]] <- .mp3 @@ -280,10 +277,6 @@ ylab0.c <- xlab0[[2]] ylab0.d <- ylab0[[3]] dots$ylab <- NULL - cat("\n----------------\nx\n--------------\n") - print(xlab0) - cat("\n----------------\ny\n--------------\n") - print(ylab0) if (hasArg("main")){ mainL <- TRUE Modified: pkg/distr/R/plot-methods_LebDec.R =================================================================== --- pkg/distr/R/plot-methods_LebDec.R 2016-01-15 16:38:52 UTC (rev 1082) +++ pkg/distr/R/plot-methods_LebDec.R 2016-01-15 16:42:34 UTC (rev 1083) @@ -247,9 +247,6 @@ if(is.na(res)) return(NULL) return(res)} iL <- 1:length(to.draw) - print(to.draw) - print(iL[to.draw==1]) - print(iL[to.draw==2]) force(lb0) .mp3 <- .mp(dlb,iL[to.draw==1]) if(1%in%to.draw & !is.null(.mp3)) lb0[[1]][["p"]] <- .mp3 @@ -280,10 +277,6 @@ ylab0.c <- xlab0[[2]] ylab0.d <- ylab0[[3]] dots$ylab <- NULL - cat("\n----------------\nx\n--------------\n") - print(xlab0) - cat("\n----------------\ny\n--------------\n") - print(ylab0) if (hasArg("main")){ mainL <- TRUE From noreply at r-forge.r-project.org Thu Jan 21 12:52:21 2016 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 21 Jan 2016 12:52:21 +0100 (CET) Subject: [Distr-commits] r1084 - in branches/distr-2.7/pkg/distr: . R inst man Message-ID: <20160121115221.5A07818754D@r-forge.r-project.org> Author: ruckdeschel Date: 2016-01-21 12:52:20 +0100 (Thu, 21 Jan 2016) New Revision: 1084 Modified: branches/distr-2.7/pkg/distr/NAMESPACE branches/distr-2.7/pkg/distr/R/AllGenerics.R branches/distr-2.7/pkg/distr/R/Distribution.R branches/distr-2.7/pkg/distr/inst/NEWS branches/distr-2.7/pkg/distr/man/p-methods.Rd branches/distr-2.7/pkg/distr/man/q-methods.Rd Log: distr:: new Methods p.r and q.l, synonyma for p and q (useful for use in RStudio) Modified: branches/distr-2.7/pkg/distr/NAMESPACE =================================================================== --- branches/distr-2.7/pkg/distr/NAMESPACE 2016-01-15 16:42:34 UTC (rev 1083) +++ branches/distr-2.7/pkg/distr/NAMESPACE 2016-01-21 11:52:20 UTC (rev 1084) @@ -84,7 +84,7 @@ "discretePart", "discretePart<-", "acPart", "acPart<-", "discreteWeight", "discreteWeight<-", "acWeight", "acWeight<-", "p.discrete", "d.discrete", "q.discrete", "r.discrete", - "p.ac", "d.ac", "q.ac", "r.ac") + "p.ac", "d.ac", "q.ac", "r.ac", "p.r", "q.l") exportMethods("decomposePM", "simplifyD", "showobj") exportMethods("Truncate","Minimum","Maximum","Huberize") exportMethods("solve", "sqrt") Modified: branches/distr-2.7/pkg/distr/R/AllGenerics.R =================================================================== --- branches/distr-2.7/pkg/distr/R/AllGenerics.R 2016-01-15 16:42:34 UTC (rev 1083) +++ branches/distr-2.7/pkg/distr/R/AllGenerics.R 2016-01-21 11:52:20 UTC (rev 1084) @@ -185,6 +185,10 @@ setGeneric("p.l", function(object) standardGeneric("p.l")) if(!isGeneric("q.r")) setGeneric("q.r", function(object) standardGeneric("q.r")) +if(!isGeneric("p.r")) + setGeneric("p.r", function(object) standardGeneric("p.r")) +if(!isGeneric("q.l")) + setGeneric("q.l", function(object) standardGeneric("q.l")) if(!isGeneric("gaps")) setGeneric("gaps", function(object) standardGeneric("gaps")) Modified: branches/distr-2.7/pkg/distr/R/Distribution.R =================================================================== --- branches/distr-2.7/pkg/distr/R/Distribution.R 2016-01-15 16:42:34 UTC (rev 1083) +++ branches/distr-2.7/pkg/distr/R/Distribution.R 2016-01-21 11:52:20 UTC (rev 1084) @@ -10,9 +10,12 @@ setMethod("r", "Distribution", function(object) object at r) setMethod("d", "Distribution", function(object) object at d) setMethod("p", "Distribution", function(object) object at p) +setMethod("p.r", "Distribution", function(object) object at p) setMethod("q", "Distribution", function(save = "default", status = 0, runLast = TRUE) save at q) ### odd arg-list due to existing function in base package +setMethod("q.l", "Distribution", + function(object) object at q) setMethod("p", "Distribution", function(object) object at p) setMethod(".lowerExact", "Distribution", function(object){ Modified: branches/distr-2.7/pkg/distr/inst/NEWS =================================================================== --- branches/distr-2.7/pkg/distr/inst/NEWS 2016-01-15 16:42:34 UTC (rev 1083) +++ branches/distr-2.7/pkg/distr/inst/NEWS 2016-01-21 11:52:20 UTC (rev 1084) @@ -21,6 +21,12 @@ + qqplot gains pattern substitution like plot in titles and x/y axis lables + pattern substitution can now be switched on and off in all plot functions according to argument withSubst ++ new methods q.l and p.r as synonyma for slot accessors q and p -- + the former one is useful in particular when using RStudio, as they + catch calls to q() [quitting an R session] and treat them separately + which renders calls to our method q() (with respective signature, + i.e., with a distribution as [first] argument) inaccessible from + the console... so far only a call to distr::q was helping... under the hood: Modified: branches/distr-2.7/pkg/distr/man/p-methods.Rd =================================================================== --- branches/distr-2.7/pkg/distr/man/p-methods.Rd 2016-01-15 16:42:34 UTC (rev 1083) +++ branches/distr-2.7/pkg/distr/man/p-methods.Rd 2016-01-21 11:52:20 UTC (rev 1084) @@ -1,5 +1,8 @@ \name{p-methods} \docType{methods} +\alias{p.r-methods} +\alias{p.r} +\alias{p.r,Distribution-method} \alias{p-methods} \alias{p} \alias{p,Distribution-method} @@ -8,12 +11,22 @@ \section{Methods}{\describe{ -\item{p}{\code{signature(object = "Distribution")}: returns the cumulative distribution function, -i.e.; \eqn{p.l(t) = P(object \le t)}{p.l(t) = P(object <= t)} } +\item{p}{\code{signature(object = "Distribution")}: returns the cumulative distribution function (c.d.f.), +i.e.; \eqn{p(t) = P(object \le t)}{p(t) = P(object <= t)} } +\item{p.r}{\code{signature(object = "Distribution")}: +from distr-2.6 onwards, we provide this as a synonym for +method \code{p}; this synonym more explicitely states that we are dealing with +the right-continuous variant of a c.d.f.} }} \seealso{ -\code{\link{Distribution-class}} +\code{\link{Distribution-class}}, \code{p.l} } +\examples{ +require(distr) +N <- Norm() +p(N)(0.3) +p.r(N)(0.3) +} \keyword{distribution} \keyword{methods} \concept{cumulative distribution function} Modified: branches/distr-2.7/pkg/distr/man/q-methods.Rd =================================================================== --- branches/distr-2.7/pkg/distr/man/q-methods.Rd 2016-01-15 16:42:34 UTC (rev 1083) +++ branches/distr-2.7/pkg/distr/man/q-methods.Rd 2016-01-21 11:52:20 UTC (rev 1084) @@ -3,17 +3,37 @@ \alias{q-methods} \alias{q} \alias{q,Distribution-method} +\alias{q.l-methods} +\alias{q.l} +\alias{q.l,Distribution-method} \title{Methods for Function q in Package `distr'} \description{q-methods} \section{Methods}{\describe{ -\item{q}{\code{signature(object = "Distribution")}: returns the +\item{q}{\code{signature(save = "Distribution")}: returns the (left-continuous) quantile function, i.e.; -\eqn{{\rm q}(s)=\inf\{t \,\big|\, P({\tt object}\leq t)\geq s\}}{q(s)=inf\{t|P(object<=t)>=s\}} +\eqn{{\rm q}(s)=\inf\{t \,\big|\, P({\tt object}\leq t)\geq s\}}{q(s)=inf\{t|P(object<=t)>=s\}}} +\item{q.l}{\code{signature(object = "Distribution")}: +from distr-2.6 onwards, we provide this as a synonym for +method \code{q}; this synonym more explicitely states that we are dealing with +the left-continuous variant of a quantile function. It is useful in particular +when used from the console in RStudio, as RStudio catches calls to +\code{q()} and treats them separately from usual R evaluation. +The developers of RStudio have been asked to fix this and comply with standard +R evaluation which explicitely allows overloading \code{q()} as we do it in this +package, but so far have refused to do so, as they claim overloading +\code{q()} was insane. }}} \seealso{ -\code{\link{Distribution-class}} +\code{\link{Distribution-class}}, \code{q.r} } +\examples{ +require(distr) +N <- Norm() +q(N)(0.3) +q.l(N)(0.3) +} + \keyword{distribution} \keyword{methods} \concept{pseudo-inverse distribution function} From noreply at r-forge.r-project.org Thu Jan 21 12:52:57 2016 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 21 Jan 2016 12:52:57 +0100 (CET) Subject: [Distr-commits] r1085 - in pkg/distr: . R inst man Message-ID: <20160121115257.813EA185F74@r-forge.r-project.org> Author: ruckdeschel Date: 2016-01-21 12:52:57 +0100 (Thu, 21 Jan 2016) New Revision: 1085 Modified: pkg/distr/NAMESPACE pkg/distr/R/AllGenerics.R pkg/distr/R/Distribution.R pkg/distr/inst/NEWS pkg/distr/man/p-methods.Rd pkg/distr/man/q-methods.Rd Log: distr:: new Methods p.r and q.l, synonyma for p and q (useful for use in RStudio) Modified: pkg/distr/NAMESPACE =================================================================== --- pkg/distr/NAMESPACE 2016-01-21 11:52:20 UTC (rev 1084) +++ pkg/distr/NAMESPACE 2016-01-21 11:52:57 UTC (rev 1085) @@ -84,7 +84,7 @@ "discretePart", "discretePart<-", "acPart", "acPart<-", "discreteWeight", "discreteWeight<-", "acWeight", "acWeight<-", "p.discrete", "d.discrete", "q.discrete", "r.discrete", - "p.ac", "d.ac", "q.ac", "r.ac") + "p.ac", "d.ac", "q.ac", "r.ac", "p.r", "q.l") exportMethods("decomposePM", "simplifyD", "showobj") exportMethods("Truncate","Minimum","Maximum","Huberize") exportMethods("solve", "sqrt") Modified: pkg/distr/R/AllGenerics.R =================================================================== --- pkg/distr/R/AllGenerics.R 2016-01-21 11:52:20 UTC (rev 1084) +++ pkg/distr/R/AllGenerics.R 2016-01-21 11:52:57 UTC (rev 1085) @@ -185,6 +185,10 @@ setGeneric("p.l", function(object) standardGeneric("p.l")) if(!isGeneric("q.r")) setGeneric("q.r", function(object) standardGeneric("q.r")) +if(!isGeneric("p.r")) + setGeneric("p.r", function(object) standardGeneric("p.r")) +if(!isGeneric("q.l")) + setGeneric("q.l", function(object) standardGeneric("q.l")) if(!isGeneric("gaps")) setGeneric("gaps", function(object) standardGeneric("gaps")) Modified: pkg/distr/R/Distribution.R =================================================================== --- pkg/distr/R/Distribution.R 2016-01-21 11:52:20 UTC (rev 1084) +++ pkg/distr/R/Distribution.R 2016-01-21 11:52:57 UTC (rev 1085) @@ -10,9 +10,12 @@ setMethod("r", "Distribution", function(object) object at r) setMethod("d", "Distribution", function(object) object at d) setMethod("p", "Distribution", function(object) object at p) +setMethod("p.r", "Distribution", function(object) object at p) setMethod("q", "Distribution", function(save = "default", status = 0, runLast = TRUE) save at q) ### odd arg-list due to existing function in base package +setMethod("q.l", "Distribution", + function(object) object at q) setMethod("p", "Distribution", function(object) object at p) setMethod(".lowerExact", "Distribution", function(object){ Modified: pkg/distr/inst/NEWS =================================================================== --- pkg/distr/inst/NEWS 2016-01-21 11:52:20 UTC (rev 1084) +++ pkg/distr/inst/NEWS 2016-01-21 11:52:57 UTC (rev 1085) @@ -21,6 +21,12 @@ + qqplot gains pattern substitution like plot in titles and x/y axis lables + pattern substitution can now be switched on and off in all plot functions according to argument withSubst ++ new methods q.l and p.r as synonyma for slot accessors q and p -- + the former one is useful in particular when using RStudio, as they + catch calls to q() [quitting an R session] and treat them separately + which renders calls to our method q() (with respective signature, + i.e., with a distribution as [first] argument) inaccessible from + the console... so far only a call to distr::q was helping... under the hood: Modified: pkg/distr/man/p-methods.Rd =================================================================== --- pkg/distr/man/p-methods.Rd 2016-01-21 11:52:20 UTC (rev 1084) +++ pkg/distr/man/p-methods.Rd 2016-01-21 11:52:57 UTC (rev 1085) @@ -1,5 +1,8 @@ \name{p-methods} \docType{methods} +\alias{p.r-methods} +\alias{p.r} +\alias{p.r,Distribution-method} \alias{p-methods} \alias{p} \alias{p,Distribution-method} @@ -8,12 +11,22 @@ \section{Methods}{\describe{ -\item{p}{\code{signature(object = "Distribution")}: returns the cumulative distribution function, -i.e.; \eqn{p.l(t) = P(object \le t)}{p.l(t) = P(object <= t)} } +\item{p}{\code{signature(object = "Distribution")}: returns the cumulative distribution function (c.d.f.), +i.e.; \eqn{p(t) = P(object \le t)}{p(t) = P(object <= t)} } +\item{p.r}{\code{signature(object = "Distribution")}: +from distr-2.6 onwards, we provide this as a synonym for +method \code{p}; this synonym more explicitely states that we are dealing with +the right-continuous variant of a c.d.f.} }} \seealso{ -\code{\link{Distribution-class}} +\code{\link{Distribution-class}}, \code{p.l} } +\examples{ +require(distr) +N <- Norm() +p(N)(0.3) +p.r(N)(0.3) +} \keyword{distribution} \keyword{methods} \concept{cumulative distribution function} Modified: pkg/distr/man/q-methods.Rd =================================================================== --- pkg/distr/man/q-methods.Rd 2016-01-21 11:52:20 UTC (rev 1084) +++ pkg/distr/man/q-methods.Rd 2016-01-21 11:52:57 UTC (rev 1085) @@ -3,17 +3,37 @@ \alias{q-methods} \alias{q} \alias{q,Distribution-method} +\alias{q.l-methods} +\alias{q.l} +\alias{q.l,Distribution-method} \title{Methods for Function q in Package `distr'} \description{q-methods} \section{Methods}{\describe{ -\item{q}{\code{signature(object = "Distribution")}: returns the +\item{q}{\code{signature(save = "Distribution")}: returns the (left-continuous) quantile function, i.e.; -\eqn{{\rm q}(s)=\inf\{t \,\big|\, P({\tt object}\leq t)\geq s\}}{q(s)=inf\{t|P(object<=t)>=s\}} +\eqn{{\rm q}(s)=\inf\{t \,\big|\, P({\tt object}\leq t)\geq s\}}{q(s)=inf\{t|P(object<=t)>=s\}}} +\item{q.l}{\code{signature(object = "Distribution")}: +from distr-2.6 onwards, we provide this as a synonym for +method \code{q}; this synonym more explicitely states that we are dealing with +the left-continuous variant of a quantile function. It is useful in particular +when used from the console in RStudio, as RStudio catches calls to +\code{q()} and treats them separately from usual R evaluation. +The developers of RStudio have been asked to fix this and comply with standard +R evaluation which explicitely allows overloading \code{q()} as we do it in this +package, but so far have refused to do so, as they claim overloading +\code{q()} was insane. }}} \seealso{ -\code{\link{Distribution-class}} +\code{\link{Distribution-class}}, \code{q.r} } +\examples{ +require(distr) +N <- Norm() +q(N)(0.3) +q.l(N)(0.3) +} + \keyword{distribution} \keyword{methods} \concept{pseudo-inverse distribution function}