r-gregmisc-users Mailing List for R gregmisc package (Page 12)
Brought to you by:
warnes
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
(12) |
Apr
(5) |
May
(3) |
Jun
(5) |
Jul
(2) |
Aug
(5) |
Sep
(7) |
Oct
(15) |
Nov
(34) |
Dec
(3) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(3) |
Feb
(16) |
Mar
(28) |
Apr
(5) |
May
|
Jun
(5) |
Jul
(9) |
Aug
(50) |
Sep
(29) |
Oct
(9) |
Nov
(25) |
Dec
(7) |
2008 |
Jan
(6) |
Feb
(4) |
Mar
(5) |
Apr
(8) |
May
(26) |
Jun
(11) |
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
(9) |
2009 |
Jan
|
Feb
(1) |
Mar
|
Apr
(2) |
May
(26) |
Jun
|
Jul
(10) |
Aug
(6) |
Sep
|
Oct
(7) |
Nov
(3) |
Dec
(2) |
2010 |
Jan
(45) |
Feb
(11) |
Mar
|
Apr
(1) |
May
(8) |
Jun
(7) |
Jul
(3) |
Aug
(1) |
Sep
|
Oct
(1) |
Nov
(9) |
Dec
(1) |
2011 |
Jan
(2) |
Feb
|
Mar
|
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
(14) |
Sep
(29) |
Oct
(3) |
Nov
|
Dec
(3) |
2012 |
Jan
|
Feb
|
Mar
|
Apr
(7) |
May
(6) |
Jun
(59) |
Jul
|
Aug
(8) |
Sep
(21) |
Oct
|
Nov
|
Dec
|
2013 |
Jan
(1) |
Feb
|
Mar
(10) |
Apr
|
May
(18) |
Jun
(25) |
Jul
(18) |
Aug
(1) |
Sep
(6) |
Oct
(28) |
Nov
(4) |
Dec
(13) |
2014 |
Jan
(7) |
Feb
(5) |
Mar
(4) |
Apr
(36) |
May
(3) |
Jun
(7) |
Jul
(46) |
Aug
(14) |
Sep
(12) |
Oct
(2) |
Nov
|
Dec
(12) |
2015 |
Jan
(4) |
Feb
|
Mar
|
Apr
(80) |
May
(36) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <wa...@us...> - 2013-12-06 21:40:14
|
Revision: 1751 http://sourceforge.net/p/r-gregmisc/code/1751 Author: warnes Date: 2013-12-06 21:40:11 +0000 (Fri, 06 Dec 2013) Log Message: ----------- Update NEWS for SII 1.0.3 Modified Paths: -------------- trunk/SII/inst/NEWS Modified: trunk/SII/inst/NEWS =================================================================== --- trunk/SII/inst/NEWS 2013-12-06 21:37:41 UTC (rev 1750) +++ trunk/SII/inst/NEWS 2013-12-06 21:40:11 UTC (rev 1751) @@ -1,7 +1,14 @@ +VERSION 1.0.3 (2013-12-06) +-------------------------- + +- Remove obsolete .First.lib() function to comply with current CRAN + package requirments. + + VERSION 1.0.2 (2011-09-01) -------------------------- -- Update Greg's emamill address. +- Update Greg's email address. - Minor changes to comply with new package standards This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-12-06 21:37:43
|
Revision: 1750 http://sourceforge.net/p/r-gregmisc/code/1750 Author: warnes Date: 2013-12-06 21:37:41 +0000 (Fri, 06 Dec 2013) Log Message: ----------- Update affiliation to "Gregory R. Warnes Consulting" Modified Paths: -------------- trunk/SII/inst/doc/SII.Rnw Modified: trunk/SII/inst/doc/SII.Rnw =================================================================== --- trunk/SII/inst/doc/SII.Rnw 2013-12-06 21:36:09 UTC (rev 1749) +++ trunk/SII/inst/doc/SII.Rnw 2013-12-06 21:37:41 UTC (rev 1750) @@ -36,7 +36,7 @@ } \author{ Gregory R. Warnes, Ph.D. \\ - Random Technologies LLC. + Gregory R. Warnes Consulting } \begin{document} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-12-06 21:36:12
|
Revision: 1749 http://sourceforge.net/p/r-gregmisc/code/1749 Author: warnes Date: 2013-12-06 21:36:09 +0000 (Fri, 06 Dec 2013) Log Message: ----------- Remove obsolete .First.lib() function and instead call data() within sii.excel(). Modified Paths: -------------- trunk/SII/DESCRIPTION trunk/SII/R/sii.excel.R Removed Paths: ------------- trunk/SII/R/First.lib.R Modified: trunk/SII/DESCRIPTION =================================================================== --- trunk/SII/DESCRIPTION 2013-11-26 14:38:58 UTC (rev 1748) +++ trunk/SII/DESCRIPTION 2013-12-06 21:36:09 UTC (rev 1749) @@ -1,8 +1,8 @@ Package: SII Type: Package Title: Calculate ANSI S3.5-1997 Speech Intelligibility Index -Version: 1.0.2 -Date: 2011-09-01 +Version: 1.0.3 +Date: 2013-12-06 Author: Gregory R. Warnes Maintainer: Gregory R. Warnes <gr...@wa...> Description: Deleted: trunk/SII/R/First.lib.R =================================================================== --- trunk/SII/R/First.lib.R 2013-11-26 14:38:58 UTC (rev 1748) +++ trunk/SII/R/First.lib.R 2013-12-06 21:36:09 UTC (rev 1749) @@ -1,4 +0,0 @@ -.First.lib <- function(libname, pkgname) - { - data(sii.constants, package=pkgname) - } Modified: trunk/SII/R/sii.excel.R =================================================================== --- trunk/SII/R/sii.excel.R 2013-11-26 14:38:58 UTC (rev 1748) +++ trunk/SII/R/sii.excel.R 2013-12-06 21:36:09 UTC (rev 1749) @@ -10,6 +10,8 @@ if(length(THDI) != length(freq)) stop("THDI must have the same length as freq") + data(sii.constants, package="SII", envir=parent.frame()) + # Interpolate unobserved frequencies sii.freqs <- sii.constants[,1] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-11-26 14:39:04
|
Revision: 1748 http://sourceforge.net/p/r-gregmisc/code/1748 Author: warnes Date: 2013-11-26 14:38:58 +0000 (Tue, 26 Nov 2013) Log Message: ----------- mixedorder() was failing to correctly handle numbers including decimals due to a faulty regular expression. Prior to the fix: > drr [1] "Dose 0.3 mg" "Dose 0.04 mg" "Dose 0.5 mg" > gtools::mixedsort(drr) [1] "Dose 0.3 mg" "Dose 0.04 mg" "Dose 0.5 mg" After the fix: > drr [1] "Dose 0.3 mg" "Dose 0.04 mg" "Dose 0.5 mg" > mixedsort(drr) [1] "Dose 0.04 mg" "Dose 0.3 mg" "Dose 0.5 mg" In addition, an optimization was added that checked if the input vector was numeric. If so, simply use the existing base::order function. Modified Paths: -------------- trunk/gtools/R/mixedsort.R Modified: trunk/gtools/R/mixedsort.R =================================================================== --- trunk/gtools/R/mixedsort.R 2013-11-18 16:06:26 UTC (rev 1747) +++ trunk/gtools/R/mixedsort.R 2013-11-26 14:38:58 UTC (rev 1748) @@ -13,7 +13,11 @@ return(NULL) else if(length(x)==1) return(1) - + + if( is.numeric(x) ) + return( order(x) ) + + delim="\\$\\@\\$" numeric <- function(x) @@ -26,16 +30,16 @@ suppressWarnings( ifelse(is.na(as.numeric(x)), toupper(x), NA) ) } - x <- as.character(x) which.nas <- which(is.na(x)) which.blanks <- which(x=="") if(length(which.blanks) >0) - x[ which.blanks ] <- -Inf + x[ which.blanks ] <- -Inf + if(length(which.nas) >0) - x[ which.nas ] <- Inf + x[ which.nas ] <- Inf #### # - Convert each character string into an vector containing single @@ -43,7 +47,7 @@ #### # find and mark numbers in the form of +1.23e+45.67 - delimited <- gsub("([+-]{0,1}[0-9]+([eE][\\+\\-]{0,1}[0-9]+){0,1})", + delimited <- gsub("([+-]{0,1}[0-9]+.{0,1}[0-9]*([eE][\\+\\-]{0,1}[0-9]+.{0,1}[0-9]*){0,1})", paste(delim,"\\1",delim,sep=""), x) # separate out numbers This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-11-18 16:06:28
|
Revision: 1747 http://sourceforge.net/p/r-gregmisc/code/1747 Author: warnes Date: 2013-11-18 16:06:26 +0000 (Mon, 18 Nov 2013) Log Message: ----------- Use ".Deprecated" instead of warning. Modified Paths: -------------- trunk/gtools/R/capture.R Modified: trunk/gtools/R/capture.R =================================================================== --- trunk/gtools/R/capture.R 2013-11-06 14:53:52 UTC (rev 1746) +++ trunk/gtools/R/capture.R 2013-11-18 16:06:26 UTC (rev 1747) @@ -26,7 +26,7 @@ capture <- function( expression, collapse="\n") { - warning("Depreciated. Use capture.output(...) from base instead.") + .Deprecated("capture.output", "base", ) resultText <- capture.output( expression ) @@ -39,6 +39,6 @@ sprint <- function(x,...) { - warning("Depreciated. Use capture.output(print(...)) from base instead.") + .Deprecated("capture.output", "base") capture(print(x,...)) } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-11-06 14:53:56
|
Revision: 1746 http://sourceforge.net/p/r-gregmisc/code/1746 Author: warnes Date: 2013-11-06 14:53:52 +0000 (Wed, 06 Nov 2013) Log Message: ----------- Update files for gtools 3.1.1 Modified Paths: -------------- trunk/gtools/DESCRIPTION trunk/gtools/inst/NEWS Modified: trunk/gtools/DESCRIPTION =================================================================== --- trunk/gtools/DESCRIPTION 2013-11-06 14:51:16 UTC (rev 1745) +++ trunk/gtools/DESCRIPTION 2013-11-06 14:53:52 UTC (rev 1746) @@ -1,8 +1,8 @@ Package: gtools Title: Various R programming tools Description: Various R programming tools -Version: 3.1.0 -Date: 2013-09-22 +Version: 3.1.1 +Date: 2013-11-06 Author: Gregory R. Warnes, Ben Bolker, and Thomas Lumley Maintainer: Gregory R. Warnes <gr...@wa...> License: LGPL-2.1 Modified: trunk/gtools/inst/NEWS =================================================================== --- trunk/gtools/inst/NEWS 2013-11-06 14:51:16 UTC (rev 1745) +++ trunk/gtools/inst/NEWS 2013-11-06 14:53:52 UTC (rev 1746) @@ -1,3 +1,12 @@ +gtools 3.1.1 - 2013-11-06 +------------------------- + +Bug fixes: + +- Fix problem with mixedorder/mixedsort when there is zero or one + elements in the argument vector. + + gtools 3.1.0 - 2013-09-22 ------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-11-06 14:51:18
|
Revision: 1745 http://sourceforge.net/p/r-gregmisc/code/1745 Author: warnes Date: 2013-11-06 14:51:16 +0000 (Wed, 06 Nov 2013) Log Message: ----------- Fix problem with mixedorder/mixedsort when there is only zero or one elements in the vector. Modified Paths: -------------- trunk/gtools/R/mixedsort.R Modified: trunk/gtools/R/mixedsort.R =================================================================== --- trunk/gtools/R/mixedsort.R 2013-10-21 23:33:29 UTC (rev 1744) +++ trunk/gtools/R/mixedsort.R 2013-11-06 14:51:16 UTC (rev 1745) @@ -9,6 +9,11 @@ # - Separately rank numbers and strings # - Combine orders so that strings follow numbers + if(length(x)<1) + return(NULL) + else if(length(x)==1) + return(1) + delim="\\$\\@\\$" numeric <- function(x) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-10-21 23:33:32
|
Revision: 1744 http://sourceforge.net/p/r-gregmisc/code/1744 Author: warnes Date: 2013-10-21 23:33:29 +0000 (Mon, 21 Oct 2013) Log Message: ----------- Handle 'ask' argument in lmplot2 function proper, rather than in (depreciated) plot.lm2 wrapper. Modified Paths: -------------- trunk/gplots/man/gplots-deprecated.Rd Modified: trunk/gplots/man/gplots-deprecated.Rd =================================================================== --- trunk/gplots/man/gplots-deprecated.Rd 2013-10-21 23:32:57 UTC (rev 1743) +++ trunk/gplots/man/gplots-deprecated.Rd 2013-10-21 23:33:29 UTC (rev 1744) @@ -16,8 +16,7 @@ panel = panel.smooth, sub.caption = deparse(x$call), main = "", - ask = interactive() && nb.fig < length(which) - && .Device != "postscript", + ask, ..., id.n = 3, labels.id = names(residuals(x)), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-10-21 23:32:59
|
Revision: 1743 http://sourceforge.net/p/r-gregmisc/code/1743 Author: warnes Date: 2013-10-21 23:32:57 +0000 (Mon, 21 Oct 2013) Log Message: ----------- Correct release number Modified Paths: -------------- trunk/gplots/inst/NEWS Modified: trunk/gplots/inst/NEWS =================================================================== --- trunk/gplots/inst/NEWS 2013-10-21 23:32:26 UTC (rev 1742) +++ trunk/gplots/inst/NEWS 2013-10-21 23:32:57 UTC (rev 1743) @@ -1,4 +1,4 @@ -Release 2.12.0 - 2013-10-14 +Release 2.12.1 - 2013-10-14 --------------------------- API Changes: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-10-21 23:32:32
|
Revision: 1742 http://sourceforge.net/p/r-gregmisc/code/1742 Author: warnes Date: 2013-10-21 23:32:26 +0000 (Mon, 21 Oct 2013) Log Message: ----------- Handle 'ask' argument in lmplot2 function proper, rather than in (depreciated) plot.lm2 wrapper. Modified Paths: -------------- trunk/gplots/R/lmplot2.R Modified: trunk/gplots/R/lmplot2.R =================================================================== --- trunk/gplots/R/lmplot2.R 2013-10-21 23:31:16 UTC (rev 1741) +++ trunk/gplots/R/lmplot2.R 2013-10-21 23:32:26 UTC (rev 1742) @@ -6,8 +6,7 @@ panel = panel.smooth, sub.caption = deparse(x$call), main = "", - ask = interactive() && nb.fig < length(which) - && .Device != "postscript", + ask, ..., id.n = 3, labels.id = names(residuals(x)), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-10-21 23:31:18
|
Revision: 1741 http://sourceforge.net/p/r-gregmisc/code/1741 Author: warnes Date: 2013-10-21 23:31:16 +0000 (Mon, 21 Oct 2013) Log Message: ----------- Fix typo Modified Paths: -------------- trunk/gplots/man/lmplot2.Rd Modified: trunk/gplots/man/lmplot2.Rd =================================================================== --- trunk/gplots/man/lmplot2.Rd 2013-10-15 02:22:29 UTC (rev 1740) +++ trunk/gplots/man/lmplot2.Rd 2013-10-21 23:31:16 UTC (rev 1741) @@ -74,6 +74,6 @@ lmplot2(x) lmplot2(x, which=1, width=1/3) -lmplot2(x, which=1:3, widht=1/3) +lmplot2(x, which=1:3, width=1/3) } \keyword{hplot} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-10-15 02:22:32
|
Revision: 1740 http://sourceforge.net/p/r-gregmisc/code/1740 Author: warnes Date: 2013-10-15 02:22:29 +0000 (Tue, 15 Oct 2013) Log Message: ----------- Add boxplot2 and lmplot2 to NAMESPACE Modified Paths: -------------- trunk/gplots/NAMESPACE Modified: trunk/gplots/NAMESPACE =================================================================== --- trunk/gplots/NAMESPACE 2013-10-15 02:13:13 UTC (rev 1739) +++ trunk/gplots/NAMESPACE 2013-10-15 02:22:29 UTC (rev 1740) @@ -3,6 +3,7 @@ bandplot, barplot2, bluered, + boxplot2, boxplot.n, ci2d, col2hex, @@ -10,6 +11,7 @@ greenred, heatmap.2, hist2d, + lmplot2, lowess, ooplot, overplot, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-10-15 02:13:16
|
Revision: 1739 http://sourceforge.net/p/r-gregmisc/code/1739 Author: warnes Date: 2013-10-15 02:13:13 +0000 (Tue, 15 Oct 2013) Log Message: ----------- Update for gplots release 2.12.1 Modified Paths: -------------- trunk/gplots/DESCRIPTION trunk/gplots/inst/NEWS Modified: trunk/gplots/DESCRIPTION =================================================================== --- trunk/gplots/DESCRIPTION 2013-10-15 02:09:31 UTC (rev 1738) +++ trunk/gplots/DESCRIPTION 2013-10-15 02:13:13 UTC (rev 1739) @@ -4,8 +4,8 @@ Depends: R (>= 3.0) Imports: gtools, gdata, stats, caTools, KernSmooth Suggests: grid, MASS -Version: 2.12.0 -Date: 2013-10-11 +Version: 2.12.1 +Date: 2013-10-14 Author: Gregory R. Warnes, Ben Bolker, Lodewijk Bonebakker, Robert Gentleman, Wolfgang Huber Andy Liaw, Thomas Lumley, Martin Maechler, Arni Magnusson, Steffen Moeller, Marc Schwartz, Bill Modified: trunk/gplots/inst/NEWS =================================================================== --- trunk/gplots/inst/NEWS 2013-10-15 02:09:31 UTC (rev 1738) +++ trunk/gplots/inst/NEWS 2013-10-15 02:13:13 UTC (rev 1739) @@ -1,6 +1,14 @@ -Release 2.12.0 - 2013-10-11 +Release 2.12.0 - 2013-10-14 --------------------------- +API Changes: + +- boxplot.n() has been renamed to boxplot2() to avoid potential S3 + method calling issues. + +- plot.lm2() has been rename to lmplot2() to avoid potential S3 method + calling issues. + Enhancements: - Add heatmap.2() parameters to control row and column label rotation This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-10-15 02:09:33
|
Revision: 1738 http://sourceforge.net/p/r-gregmisc/code/1738 Author: warnes Date: 2013-10-15 02:09:31 +0000 (Tue, 15 Oct 2013) Log Message: ----------- Rename boxplot.n to boxplt2 and plot.lm2 to lmplot2 Modified Paths: -------------- trunk/gplots/man/gplots-deprecated.Rd Added Paths: ----------- trunk/gplots/R/boxplot2.R trunk/gplots/R/lmplot2.R trunk/gplots/man/boxplot2.Rd trunk/gplots/man/lmplot2.Rd Removed Paths: ------------- trunk/gplots/R/boxplot.n.R trunk/gplots/R/plot.lm.R trunk/gplots/man/boxplot.n.Rd trunk/gplots/man/boxplot2.Rd trunk/gplots/man/lmplot2.Rd trunk/gplots/man/plot.lm2.Rd Deleted: trunk/gplots/R/boxplot.n.R =================================================================== --- trunk/gplots/R/boxplot.n.R 2013-10-15 01:47:31 UTC (rev 1737) +++ trunk/gplots/R/boxplot.n.R 2013-10-15 02:09:31 UTC (rev 1738) @@ -1,52 +0,0 @@ -# $Id$ - -boxplot.n <- function( ..., top=FALSE, shrink=1.0, textcolor=NULL ) - { - boxcall <- match.call() # get call - boxcall$top <- boxcall$shrink <- boxcall$textcolor <- NULL - boxcall[[1]] <- as.name("boxplot") - - if(is.R()) - { - box <- eval(boxcall, parent.frame()) - mids <- 1:length(box$n) - } - else - { - mids <- eval(boxcall, parent.frame()) - boxcall$plot <- FALSE - box <- eval(boxcall, parent.frame()) - } - - if(top) - { - where <- par("usr")[4] - adj <- c(0.5,1) - } - else - { - where <- par("usr")[3] - adj <- c(0.5,0) - } - tcex <- par("cex") - par(cex=shrink*tcex) - - if(is.R()) - text( x=mids, y=where, labels=paste("n=",box$n,sep=""), adj=adj, - col=textcolor) - else - { - if( is.null(textcolor) ) - textcolor <- 1 - space <- ifelse(top, -1, 1) * par("1em")[2] / 2 - - text( x=mids, y=where + space, labels=paste("n=",box$n,sep=""), adj=adj[1], - col=textcolor) - - } - - par(cex=tcex) - - invisible(box) - } - Copied: trunk/gplots/R/boxplot2.R (from rev 1672, trunk/gplots/R/boxplot.n.R) =================================================================== --- trunk/gplots/R/boxplot2.R (rev 0) +++ trunk/gplots/R/boxplot2.R 2013-10-15 02:09:31 UTC (rev 1738) @@ -0,0 +1,60 @@ +# $Id$ +boxplot.n <- function( ..., top=FALSE, shrink=1.0, textcolor=NULL ) + { + .Deprecated("gboxplot", package="gplots") + cl <- match.call() + mf <- match.call(expand.dots = FALSE) + mf[[1L]] <- quote(boxplot2) + eval(mf, parent.frame()) + } + +boxplot2 <- function( ..., top=FALSE, shrink=1.0, textcolor=NULL ) + { + boxcall <- match.call() # get call + boxcall$top <- boxcall$shrink <- boxcall$textcolor <- NULL + boxcall[[1]] <- as.name("boxplot") + + if(is.R()) + { + box <- eval(boxcall, parent.frame()) + mids <- 1:length(box$n) + } + else + { + mids <- eval(boxcall, parent.frame()) + boxcall$plot <- FALSE + box <- eval(boxcall, parent.frame()) + } + + if(top) + { + where <- par("usr")[4] + adj <- c(0.5,1) + } + else + { + where <- par("usr")[3] + adj <- c(0.5,0) + } + tcex <- par("cex") + par(cex=shrink*tcex) + + if(is.R()) + text( x=mids, y=where, labels=paste("n=",box$n,sep=""), adj=adj, + col=textcolor) + else + { + if( is.null(textcolor) ) + textcolor <- 1 + space <- ifelse(top, -1, 1) * par("1em")[2] / 2 + + text( x=mids, y=where + space, labels=paste("n=",box$n,sep=""), adj=adj[1], + col=textcolor) + + } + + par(cex=tcex) + + invisible(box) + } + Copied: trunk/gplots/R/lmplot2.R (from rev 1672, trunk/gplots/R/plot.lm.R) =================================================================== --- trunk/gplots/R/lmplot2.R (rev 0) +++ trunk/gplots/R/lmplot2.R 2013-10-15 02:09:31 UTC (rev 1738) @@ -0,0 +1,183 @@ +plot.lm2 <- function( + x, + which = 1:5, + caption = c("Residuals vs Fitted", "Normal Q-Q plot", + "Scale-Location plot", "Cook's distance plot"), + panel = panel.smooth, + sub.caption = deparse(x$call), + main = "", + ask = interactive() && nb.fig < length(which) + && .Device != "postscript", + ..., + id.n = 3, + labels.id = names(residuals(x)), + cex.id = 0.75, + band=TRUE, + rug=TRUE, + width=1/10, + max.n=5000 + ) +{ + cl <- match.call() + mf <- match.call(expand.dots = FALSE) + mf[[1L]] <- quote(lmplot2) + eval(mf, parent.frame()) +} + + +lmplot2 <- function( + x, + which = 1:5, + caption = c("Residuals vs Fitted", "Normal Q-Q plot", + "Scale-Location plot", "Cook's distance plot"), + panel = panel.smooth, + sub.caption = deparse(x$call), + main = "", + ask = interactive() && nb.fig < length(which) + && .Device != "postscript", + ..., + id.n = 3, + labels.id = names(residuals(x)), + cex.id = 0.75, + band=TRUE, + rug=TRUE, + width=1/10, + max.n=5000 + ) +{ + if (!inherits(x, "lm")) + stop("Use only with 'lm' objects") + show <- rep(FALSE, 5) + if(!is.numeric(which) || any(which < 1) || any(which > 5)) + stop("`which' must be in 1:5") + show[which] <- TRUE + r <- residuals(x) + n <- length(r) + if(inherits(x,"glm")) + yh <- predict(x) # != fitted() for glm + else + yh <- fitted(x) + if (any(show[2:4])) + s <- if(inherits(x, "rlm")) x$s else sqrt(deviance(x)/df.residual(x)) + if (any(show[2:3])) { + ylab23 <- if(inherits(x, "glm")) + "Std. deviance resid." else "Standardized residuals" + hii <- lm.influence(x)$hat + w <- weights(x) + # r.w := weighted.residuals(x): + r.w <- if(is.null(w)) r else (sqrt(w)*r)[w!=0] + rs <- r.w/(s * sqrt(1 - hii)) + } + if (any(show[c(1,3)])) + l.fit <- if(inherits(x,"glm")) + "Predicted values" else "Fitted values" + if (is.null(id.n)) + id.n <- 0 + else { + id.n <- as.integer(id.n) + if(id.n < 0 || id.n > n) + stop(paste("`id.n' must be in { 1,..,",n,"}")) + } + if(id.n > 0) { + if(is.null(labels.id)) + labels.id <- paste(1:n) + iid <- 1:id.n + show.r <- order(-abs(r))[iid] + if(any(show[2:3])) + show.rs <- order(-abs(rs))[iid] + text.id <- function(x,y, ind, adj.x = FALSE) + text(x - if(adj.x) strwidth(" ")*cex.id else 0, y, labels.id[ind], + cex = cex.id, xpd = TRUE, adj = if(adj.x) 1) + } + nb.fig <- prod(par("mfcol")) + one.fig <- prod(par("mfcol")) == 1 + if (ask) { + op <- par(ask = TRUE) + on.exit(par(op)) + } + ##---------- Do the individual plots : ---------- + if (show[1]) { + ylim <- range(r) + if(id.n > 0) + ylim <- ylim + c(-1,1)* 0.08 * diff(ylim) + plot(yh, r, xlab = l.fit, ylab = "Residuals", main = main, + ylim = ylim, type = "n", ...) + panel(yh, r, ...) + if(rug) rug(yh) ## GRW 2001-06-08 + if(band) bandplot(yh,r,add=TRUE,width=width) ## GRW 2001-06-08 + if (one.fig) + title(sub = sub.caption, ...) + mtext(caption[1], 3, 0.25) + if(id.n > 0) { + y.id <- r[show.r] + y.id[y.id < 0] <- y.id[y.id < 0] - strheight(" ")/3 + text.id(yh[show.r], y.id, show.r, adj.x = TRUE) + } + abline(h = 0, lty = 3, col = "gray") + } + if (show[2]) { + ylim <- range(rs) + ylim[2] <- ylim[2] + diff(ylim) * 0.075 + qq <- qqnorm(rs, main = main, ylab = ylab23, ylim = ylim, ...) + qqline(rs) + if (one.fig) + title(sub = sub.caption, ...) + mtext(caption[2], 3, 0.25) + if(id.n > 0) + text.id(qq$x[show.rs], qq$y[show.rs], show.rs, adj.x = TRUE) + } + if (show[3]) { + sqrtabsr <- sqrt(abs(rs)) + ylim <- c(0, max(sqrtabsr)) + yl <- as.expression(substitute(sqrt(abs(YL)), list(YL=as.name(ylab23)))) + yhn0 <- if(is.null(w)) yh else yh[w!=0] + plot(yhn0, sqrtabsr, xlab = l.fit, ylab = yl, main = main, + ylim = ylim, type = "n", ...) + panel(yhn0, sqrtabsr, ...) + + abline(h=mean(sqrtabsr),lty = 3, col = "gray") + if(rug) rug(yh) ## GRW 2001-06-08 + if(band) bandplot(yhn0,sqrtabsr,add=TRUE) ## GRW 2001-06-08 + + if (one.fig) + title(sub = sub.caption, ...) + mtext(caption[3], 3, 0.25) + if(id.n > 0) + text.id(yhn0[show.rs], sqrtabsr[show.rs], show.rs, adj.x = TRUE) + } + if (show[4]) { + cook <- cooks.distance(x, sd=s) + if(id.n > 0) { + show.r <- order(-cook)[iid]# index of largest `id.n' ones + ymx <- cook[show.r[1]] * 1.075 + } else ymx <- max(cook) + plot(cook, type = "h", ylim = c(0, ymx), main = main, + xlab = "Obs. number", ylab = "Cook's distance", ...) + if (one.fig) + title(sub = sub.caption, ...) + mtext(caption[4], 3, 0.25) + if(id.n > 0) + text.id(show.r, cook[show.r] + 0.4*cex.id * strheight(" "), show.r) + } + if (show[5]) + { + ## plot residuals against each predictor ## + data <- model.frame(x) + for( i in 2:ncol(data) ) + { + test <- try( + { + plot.default( x=data[,i], y=r, + xlab=names(data)[i], ylab="Residuals", type="n") + panel( data[,i], r, ... ) + if(rug) rug(data[,i]) + if(band) bandplot(data[,i],r,add=TRUE) + abline(h=0,lty = 3, col = "gray") + } + ) + } + } + if (!one.fig && par("oma")[3] >= 1) + mtext(sub.caption, outer = TRUE, cex = 1.25) + invisible() +} Deleted: trunk/gplots/R/plot.lm.R =================================================================== --- trunk/gplots/R/plot.lm.R 2013-10-15 01:47:31 UTC (rev 1737) +++ trunk/gplots/R/plot.lm.R 2013-10-15 02:09:31 UTC (rev 1738) @@ -1,156 +0,0 @@ -plot.lm2 <- function( - x, - which = 1:5, - caption = c("Residuals vs Fitted", "Normal Q-Q plot", - "Scale-Location plot", "Cook's distance plot"), - panel = panel.smooth, - sub.caption = deparse(x$call), - main = "", - ask = interactive() && nb.fig < length(which) - && .Device != "postscript", - ..., - id.n = 3, - labels.id = names(residuals(x)), - cex.id = 0.75, - band=TRUE, - rug=TRUE, - width=1/10, - max.n=5000 - ) -{ - if (!inherits(x, "lm")) - stop("Use only with 'lm' objects") - show <- rep(FALSE, 5) - if(!is.numeric(which) || any(which < 1) || any(which > 5)) - stop("`which' must be in 1:5") - show[which] <- TRUE - r <- residuals(x) - n <- length(r) - if(inherits(x,"glm")) - yh <- predict(x) # != fitted() for glm - else - yh <- fitted(x) - if (any(show[2:4])) - s <- if(inherits(x, "rlm")) x$s else sqrt(deviance(x)/df.residual(x)) - if (any(show[2:3])) { - ylab23 <- if(inherits(x, "glm")) - "Std. deviance resid." else "Standardized residuals" - hii <- lm.influence(x)$hat - w <- weights(x) - # r.w := weighted.residuals(x): - r.w <- if(is.null(w)) r else (sqrt(w)*r)[w!=0] - rs <- r.w/(s * sqrt(1 - hii)) - } - if (any(show[c(1,3)])) - l.fit <- if(inherits(x,"glm")) - "Predicted values" else "Fitted values" - if (is.null(id.n)) - id.n <- 0 - else { - id.n <- as.integer(id.n) - if(id.n < 0 || id.n > n) - stop(paste("`id.n' must be in { 1,..,",n,"}")) - } - if(id.n > 0) { - if(is.null(labels.id)) - labels.id <- paste(1:n) - iid <- 1:id.n - show.r <- order(-abs(r))[iid] - if(any(show[2:3])) - show.rs <- order(-abs(rs))[iid] - text.id <- function(x,y, ind, adj.x = FALSE) - text(x - if(adj.x) strwidth(" ")*cex.id else 0, y, labels.id[ind], - cex = cex.id, xpd = TRUE, adj = if(adj.x) 1) - } - nb.fig <- prod(par("mfcol")) - one.fig <- prod(par("mfcol")) == 1 - if (ask) { - op <- par(ask = TRUE) - on.exit(par(op)) - } - ##---------- Do the individual plots : ---------- - if (show[1]) { - ylim <- range(r) - if(id.n > 0) - ylim <- ylim + c(-1,1)* 0.08 * diff(ylim) - plot(yh, r, xlab = l.fit, ylab = "Residuals", main = main, - ylim = ylim, type = "n", ...) - panel(yh, r, ...) - if(rug) rug(yh) ## GRW 2001-06-08 - if(band) bandplot(yh,r,add=TRUE,width=width) ## GRW 2001-06-08 - if (one.fig) - title(sub = sub.caption, ...) - mtext(caption[1], 3, 0.25) - if(id.n > 0) { - y.id <- r[show.r] - y.id[y.id < 0] <- y.id[y.id < 0] - strheight(" ")/3 - text.id(yh[show.r], y.id, show.r, adj.x = TRUE) - } - abline(h = 0, lty = 3, col = "gray") - } - if (show[2]) { - ylim <- range(rs) - ylim[2] <- ylim[2] + diff(ylim) * 0.075 - qq <- qqnorm(rs, main = main, ylab = ylab23, ylim = ylim, ...) - qqline(rs) - if (one.fig) - title(sub = sub.caption, ...) - mtext(caption[2], 3, 0.25) - if(id.n > 0) - text.id(qq$x[show.rs], qq$y[show.rs], show.rs, adj.x = TRUE) - } - if (show[3]) { - sqrtabsr <- sqrt(abs(rs)) - ylim <- c(0, max(sqrtabsr)) - yl <- as.expression(substitute(sqrt(abs(YL)), list(YL=as.name(ylab23)))) - yhn0 <- if(is.null(w)) yh else yh[w!=0] - plot(yhn0, sqrtabsr, xlab = l.fit, ylab = yl, main = main, - ylim = ylim, type = "n", ...) - panel(yhn0, sqrtabsr, ...) - - abline(h=mean(sqrtabsr),lty = 3, col = "gray") - if(rug) rug(yh) ## GRW 2001-06-08 - if(band) bandplot(yhn0,sqrtabsr,add=TRUE) ## GRW 2001-06-08 - - if (one.fig) - title(sub = sub.caption, ...) - mtext(caption[3], 3, 0.25) - if(id.n > 0) - text.id(yhn0[show.rs], sqrtabsr[show.rs], show.rs, adj.x = TRUE) - } - if (show[4]) { - cook <- cooks.distance(x, sd=s) - if(id.n > 0) { - show.r <- order(-cook)[iid]# index of largest `id.n' ones - ymx <- cook[show.r[1]] * 1.075 - } else ymx <- max(cook) - plot(cook, type = "h", ylim = c(0, ymx), main = main, - xlab = "Obs. number", ylab = "Cook's distance", ...) - if (one.fig) - title(sub = sub.caption, ...) - mtext(caption[4], 3, 0.25) - if(id.n > 0) - text.id(show.r, cook[show.r] + 0.4*cex.id * strheight(" "), show.r) - } - if (show[5]) - { - ## plot residuals against each predictor ## - data <- model.frame(x) - for( i in 2:ncol(data) ) - { - test <- try( - { - plot.default( x=data[,i], y=r, - xlab=names(data)[i], ylab="Residuals", type="n") - panel( data[,i], r, ... ) - if(rug) rug(data[,i]) - if(band) bandplot(data[,i],r,add=TRUE) - abline(h=0,lty = 3, col = "gray") - } - ) - } - } - if (!one.fig && par("oma")[3] >= 1) - mtext(sub.caption, outer = TRUE, cex = 1.25) - invisible() -} Deleted: trunk/gplots/man/boxplot.n.Rd =================================================================== --- trunk/gplots/man/boxplot.n.Rd 2013-10-15 01:47:31 UTC (rev 1737) +++ trunk/gplots/man/boxplot.n.Rd 2013-10-15 02:09:31 UTC (rev 1738) @@ -1,57 +0,0 @@ -% $Id$ -% -% $Log$ -% Revision 1.5 2005/12/01 16:46:52 nj7w -% Updated Greg's email address -% -% Revision 1.4 2005/06/09 14:20:28 nj7w -% Updating the version number, and various help files to synchronize splitting of gregmisc bundle in 4 individual components. -% -% Revision 1.1.1.1 2005/05/25 22:15:30 nj7w -% Initial submission as an individual package -% -% Revision 1.3 2002/04/09 00:51:31 warneg -% -% Checkin for version 0.5.3 -% -% Revision 1.2 2001/08/25 05:46:21 warneg -% Added CVS header. -% -% Revision 1.1 2001/08/25 05:45:10 warneg -% Initial Checkin -% -\name{boxplot.n} -\alias{boxplot.n} -\title{Produce a Boxplot Annotated with the Number of Observations} -\description{ - This funcntion uses \code{boxplot} to produce a boxplot which is then - annotated with the number of observations in each group. -} -\usage{ -boxplot.n(..., top=FALSE, shrink=1, textcolor=NULL) -} -\arguments{ - \item{\dots}{ parameters passed to \code{boxplot}. } - \item{top}{ logical indicating whether the number of observations - should be added to the top or the bottom of the plotting - region. Defaults to \code{FALSE}. } - \item{shrink}{ value to shrink character size (cex) when annotating.} - \item{textcolor}{ text color. } -} -\author{ Gregory R. Warnes \email{gr...@wa...}} -\seealso{ \code{\link{boxplot}}, \code{\link{text}}} - -\examples{ -data(state) - -# n's at bottom -boxplot.n( state.area ~ state.region) - -# n's at top -boxplot.n( state.area ~ state.region, top=TRUE) - -# small red text -boxplot.n( state.area ~ state.region, shrink=0.8, textcolor="red") -} - -\keyword{ hplot } Deleted: trunk/gplots/man/boxplot2.Rd =================================================================== --- trunk/gplots/man/boxplot2.Rd 2013-10-15 01:47:31 UTC (rev 1737) +++ trunk/gplots/man/boxplot2.Rd 2013-10-15 02:09:31 UTC (rev 1738) @@ -1,57 +0,0 @@ -% $Id$ -% -% $Log$ -% Revision 1.5 2005/12/01 16:46:52 nj7w -% Updated Greg's email address -% -% Revision 1.4 2005/06/09 14:20:28 nj7w -% Updating the version number, and various help files to synchronize splitting of gregmisc bundle in 4 individual components. -% -% Revision 1.1.1.1 2005/05/25 22:15:30 nj7w -% Initial submission as an individual package -% -% Revision 1.3 2002/04/09 00:51:31 warneg -% -% Checkin for version 0.5.3 -% -% Revision 1.2 2001/08/25 05:46:21 warneg -% Added CVS header. -% -% Revision 1.1 2001/08/25 05:45:10 warneg -% Initial Checkin -% -\name{boxplot.n} -\alias{boxplot.n} -\title{Produce a Boxplot Annotated with the Number of Observations} -\description{ - This funcntion uses \code{boxplot} to produce a boxplot which is then - annotated with the number of observations in each group. -} -\usage{ -boxplot.n(..., top=FALSE, shrink=1, textcolor=NULL) -} -\arguments{ - \item{\dots}{ parameters passed to \code{boxplot}. } - \item{top}{ logical indicating whether the number of observations - should be added to the top or the bottom of the plotting - region. Defaults to \code{FALSE}. } - \item{shrink}{ value to shrink character size (cex) when annotating.} - \item{textcolor}{ text color. } -} -\author{ Gregory R. Warnes \email{gr...@wa...}} -\seealso{ \code{\link{boxplot}}, \code{\link{text}}} - -\examples{ -data(state) - -# n's at bottom -boxplot.n( state.area ~ state.region) - -# n's at top -boxplot.n( state.area ~ state.region, top=TRUE) - -# small red text -boxplot.n( state.area ~ state.region, shrink=0.8, textcolor="red") -} - -\keyword{ hplot } Copied: trunk/gplots/man/boxplot2.Rd (from rev 1672, trunk/gplots/man/boxplot.n.Rd) =================================================================== --- trunk/gplots/man/boxplot2.Rd (rev 0) +++ trunk/gplots/man/boxplot2.Rd 2013-10-15 02:09:31 UTC (rev 1738) @@ -0,0 +1,42 @@ +\name{boxplot2} +\alias{boxplot2} +\title{Produce a Boxplot Annotated with the Number of Observations} +\description{ + This funcntion uses \code{boxplot} to produce a boxplot which is then + annotated with the number of observations in each group. +} +\usage{ +boxplot2(..., top=FALSE, shrink=1, textcolor=NULL) +} +\arguments{ + \item{\dots}{ parameters passed to \code{boxplot}. } + \item{top}{ logical indicating whether the number of observations + should be added to the top or the bottom of the plotting + region. Defaults to \code{FALSE}. } + \item{shrink}{ value to shrink character size (cex) when annotating.} + \item{textcolor}{ text color. } +} +\author{ Gregory R. Warnes \email{gr...@wa...}} +\note{ + This function replaces \code{boxplot.n}, which has been deprecated + avoid potential problems with S3 method dispatching. +} +\seealso{ + \code{\link{boxplot}}, + \code{\link{text}} +} + +\examples{ +data(state) + +# n's at bottom +boxplot2( state.area ~ state.region) + +# n's at top +boxplot2( state.area ~ state.region, top=TRUE) + +# small red text +boxplot2( state.area ~ state.region, shrink=0.8, textcolor="red") +} + +\keyword{ hplot } Modified: trunk/gplots/man/gplots-deprecated.Rd =================================================================== --- trunk/gplots/man/gplots-deprecated.Rd 2013-10-15 01:47:31 UTC (rev 1737) +++ trunk/gplots/man/gplots-deprecated.Rd 2013-10-15 02:09:31 UTC (rev 1738) @@ -1,57 +1,53 @@ -% $Id$ -% -% $Log$ -% Revision 1.5 2005/12/01 16:46:52 nj7w -% Updated Greg's email address -% -% Revision 1.4 2005/06/09 14:20:28 nj7w -% Updating the version number, and various help files to synchronize splitting of gregmisc bundle in 4 individual components. -% -% Revision 1.1.1.1 2005/05/25 22:15:30 nj7w -% Initial submission as an individual package -% -% Revision 1.3 2002/04/09 00:51:31 warneg -% -% Checkin for version 0.5.3 -% -% Revision 1.2 2001/08/25 05:46:21 warneg -% Added CVS header. -% -% Revision 1.1 2001/08/25 05:45:10 warneg -% Initial Checkin -% -\name{boxplot.n} +\name{gplots-deprecated} \alias{boxplot.n} -\title{Produce a Boxplot Annotated with the Number of Observations} +\alias{plot.lm2} +\title{Deprecated functions} \description{ - This funcntion uses \code{boxplot} to produce a boxplot which is then - annotated with the number of observations in each group. + These funcntion have been deprecated and will be removed in future + releases of gplots. } \usage{ -boxplot.n(..., top=FALSE, shrink=1, textcolor=NULL) + boxplot.n(..., top=FALSE, shrink=1, textcolor=NULL) + plot.lm2( + x, + which = 1:5, + caption = c("Residuals vs Fitted", "Normal Q-Q plot", + "Scale-Location plot", "Cook's distance plot"), + panel = panel.smooth, + sub.caption = deparse(x$call), + main = "", + ask = interactive() && nb.fig < length(which) + && .Device != "postscript", + ..., + id.n = 3, + labels.id = names(residuals(x)), + cex.id = 0.75, + band=TRUE, + rug=TRUE, + width=1/10, + max.n=5000 + ) } \arguments{ - \item{\dots}{ parameters passed to \code{boxplot}. } - \item{top}{ logical indicating whether the number of observations - should be added to the top or the bottom of the plotting - region. Defaults to \code{FALSE}. } - \item{shrink}{ value to shrink character size (cex) when annotating.} - \item{textcolor}{ text color. } + \item{\dots}{see man page for the corresponding replacement function} + \item{top, shrink, textcolor}{See man page for + \code{\link{boxplot2}}.} + \item{x, which, caption, panel, sub.caption, main, ask, id.n, + labels.id, cex.id, band, rug, width, max.n}{See man page for + \code{\link{lmplot2}}.} } -\author{ Gregory R. Warnes \email{gr...@wa...}} -\seealso{ \code{\link{boxplot}}, \code{\link{text}}} - -\examples{ -data(state) - -# n's at bottom -boxplot.n( state.area ~ state.region) - -# n's at top -boxplot.n( state.area ~ state.region, top=TRUE) - -# small red text -boxplot.n( state.area ~ state.region, shrink=0.8, textcolor="red") +\details{ +These functions have been deprecated. Please refer to the manual page +for the replacement function: + \itemize{ + \item \code{boxplot.n} has been replaced by \code{\link{boxplot2}} + \item \code{plot.lm2} has been replaced by \code{\link{lmplot2}} + } } - -\keyword{ hplot } +\author{Gregory R. Warnes \email{gr...@wa...}} +\seealso{ + \code{\link{boxplot2}}, + \code{\link{lmplot2}}, + \code{\link[base]{Deprecated}} +} +\keyword{misc} Deleted: trunk/gplots/man/lmplot2.Rd =================================================================== --- trunk/gplots/man/lmplot2.Rd 2013-10-15 01:47:31 UTC (rev 1737) +++ trunk/gplots/man/lmplot2.Rd 2013-10-15 02:09:31 UTC (rev 1738) @@ -1,71 +0,0 @@ -\name{plot.lm2} -\alias{plot.lm2} -\title{ - Plots to assess the goodness of fit for the linear model objects -} -\description{ - Plots to assess the goodness of fit for the linear model objects - } - \usage{ - plot.lm2( - x, - which = 1:5, - caption = c("Residuals vs Fitted", "Normal Q-Q plot", - "Scale-Location plot", "Cook's distance plot"), - panel = panel.smooth, - sub.caption = deparse(x$call), - main = "", - ask = interactive() && nb.fig < length(which) - && .Device != "postscript", - ..., - id.n = 3, - labels.id = names(residuals(x)), - cex.id = 0.75, - band=TRUE, - rug=TRUE, - width=1/10, - max.n=5000 - ) -} -\arguments{ - \item{x}{lm object} - \item{which}{Numerical values between 1 and 5, indicating which plots - to be shown. The codes are: - - 1- fitted vs residuals plot - 2- Normal Q-Q plot - 3- Scale-Location plot - 4- Cook's distance plot - 5- residuals vs each predictor plot - } - \item{caption}{ Caption for each type of plot} - \item{panel}{ function to draw on the existing plot} - \item{sub.caption}{ SubCaption for the plots } - \item{main}{Main title of the plot} - \item{ask}{whether interactive graphics or postscript } - \item{\dots}{ parameters passed to \code{plot.lm2}. } - \item{id.n}{ integer value, less than or equal to residuals of lm object } - \item{labels.id}{Names of the residuals of the lm object} - \item{cex.id}{Parameter to control the height of text stringsx} - \item{band}{logical vector indicating whether bandplot should also be plotted } - \item{rug}{logical vector indicating whether rug should be added to - the existing plot } - \item{width}{Fraction of the data to use for plot smooths} - \item{max.n}{Maximum number of points to display in plots} -} -\author{Gregory R. Warnes \email{gr...@wa...} and Nitin - Jain \email{nit...@pf...}} -\examples{ -ctl <- rnorm(100, 4) -trt <- rnorm(100, 4.5) -group <- gl(2,100,200, labels=c("Ctl","Trt")) -weight <- c(ctl, trt) -wt.err <- rnorm(length(weight), mean=weight, sd=1/2) -x <- lm(weight ~ group + wt.err) - -plot.lm2(x) - -plot.lm2(x, which=1, width=1/3) -plot.lm2(x, which=1:3, widht=1/3) -} -\keyword{hplot} Copied: trunk/gplots/man/lmplot2.Rd (from rev 1735, trunk/gplots/man/plot.lm2.Rd) =================================================================== --- trunk/gplots/man/lmplot2.Rd (rev 0) +++ trunk/gplots/man/lmplot2.Rd 2013-10-15 02:09:31 UTC (rev 1738) @@ -0,0 +1,79 @@ +\name{lmplot2} +\alias{lmplot2} +\title{ + Plots to assess the goodness of fit for the linear model objects +} +\description{ + Plots to assess the goodness of fit for the linear model objects + } + \usage{ + lmplot2( + x, + which = 1:5, + caption = c("Residuals vs Fitted", "Normal Q-Q plot", + "Scale-Location plot", "Cook's distance plot"), + panel = panel.smooth, + sub.caption = deparse(x$call), + main = "", + ask = interactive() && nb.fig < length(which) + && .Device != "postscript", + ..., + id.n = 3, + labels.id = names(residuals(x)), + cex.id = 0.75, + band=TRUE, + rug=TRUE, + width=1/10, + max.n=5000 + ) +} +\arguments{ + \item{x}{lm object} + \item{which}{Numerical values between 1 and 5, indicating which plots + to be shown. The codes are: + \describe{ + \item{1}{Fitted vs residuals} + \item{2}{Normal Q-Q} + \item{3}{Scale-Location} + \item{4}{Cook's distance} + \item{5}{Residuals vs. predictor} + } + } + \item{caption}{ Caption for each type of plot} + \item{panel}{ function to draw on the existing plot} + \item{sub.caption}{ SubCaption for the plots } + \item{main}{Main title of the plot} + \item{ask}{whether interactive graphics or postscript } + \item{\dots}{ parameters passed to \code{lmplot2}. } + \item{id.n}{ integer value, less than or equal to residuals of lm object } + \item{labels.id}{Names of the residuals of the lm object} + \item{cex.id}{Parameter to control the height of text stringsx} + \item{band}{logical vector indicating whether bandplot should also be plotted } + \item{rug}{logical vector indicating whether rug should be added to + the existing plot } + \item{width}{Fraction of the data to use for plot smooths} + \item{max.n}{Maximum number of points to display in plots} +} +\note{ + This function replaces \code{boxplot.n}, which has been deprecated + avoid potential problems with S3 method dispatching. +} +\author{Gregory R. Warnes \email{gr...@wa...} and Nitin + Jain \email{nit...@pf...}} +\seealso{ + \code{\link[stats]{plot.lm}} + } +\examples{ +ctl <- rnorm(100, 4) +trt <- rnorm(100, 4.5) +group <- gl(2,100,200, labels=c("Ctl","Trt")) +weight <- c(ctl, trt) +wt.err <- rnorm(length(weight), mean=weight, sd=1/2) +x <- lm(weight ~ group + wt.err) + +lmplot2(x) + +lmplot2(x, which=1, width=1/3) +lmplot2(x, which=1:3, widht=1/3) +} +\keyword{hplot} Deleted: trunk/gplots/man/plot.lm2.Rd =================================================================== --- trunk/gplots/man/plot.lm2.Rd 2013-10-15 01:47:31 UTC (rev 1737) +++ trunk/gplots/man/plot.lm2.Rd 2013-10-15 02:09:31 UTC (rev 1738) @@ -1,71 +0,0 @@ -\name{plot.lm2} -\alias{plot.lm2} -\title{ - Plots to assess the goodness of fit for the linear model objects -} -\description{ - Plots to assess the goodness of fit for the linear model objects - } - \usage{ - plot.lm2( - x, - which = 1:5, - caption = c("Residuals vs Fitted", "Normal Q-Q plot", - "Scale-Location plot", "Cook's distance plot"), - panel = panel.smooth, - sub.caption = deparse(x$call), - main = "", - ask = interactive() && nb.fig < length(which) - && .Device != "postscript", - ..., - id.n = 3, - labels.id = names(residuals(x)), - cex.id = 0.75, - band=TRUE, - rug=TRUE, - width=1/10, - max.n=5000 - ) -} -\arguments{ - \item{x}{lm object} - \item{which}{Numerical values between 1 and 5, indicating which plots - to be shown. The codes are: - - 1- fitted vs residuals plot - 2- Normal Q-Q plot - 3- Scale-Location plot - 4- Cook's distance plot - 5- residuals vs each predictor plot - } - \item{caption}{ Caption for each type of plot} - \item{panel}{ function to draw on the existing plot} - \item{sub.caption}{ SubCaption for the plots } - \item{main}{Main title of the plot} - \item{ask}{whether interactive graphics or postscript } - \item{\dots}{ parameters passed to \code{plot.lm2}. } - \item{id.n}{ integer value, less than or equal to residuals of lm object } - \item{labels.id}{Names of the residuals of the lm object} - \item{cex.id}{Parameter to control the height of text stringsx} - \item{band}{logical vector indicating whether bandplot should also be plotted } - \item{rug}{logical vector indicating whether rug should be added to - the existing plot } - \item{width}{Fraction of the data to use for plot smooths} - \item{max.n}{Maximum number of points to display in plots} -} -\author{Gregory R. Warnes \email{gr...@wa...} and Nitin - Jain \email{nit...@pf...}} -\examples{ -ctl <- rnorm(100, 4) -trt <- rnorm(100, 4.5) -group <- gl(2,100,200, labels=c("Ctl","Trt")) -weight <- c(ctl, trt) -wt.err <- rnorm(length(weight), mean=weight, sd=1/2) -x <- lm(weight ~ group + wt.err) - -plot.lm2(x) - -plot.lm2(x, which=1, width=1/3) -plot.lm2(x, which=1:3, widht=1/3) -} -\keyword{hplot} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-10-15 01:47:34
|
Revision: 1737 http://sourceforge.net/p/r-gregmisc/code/1737 Author: warnes Date: 2013-10-15 01:47:31 +0000 (Tue, 15 Oct 2013) Log Message: ----------- Make lmplot2 manual page from plot.lm.2 manual page. Added Paths: ----------- trunk/gplots/man/lmplot2.Rd Copied: trunk/gplots/man/lmplot2.Rd (from rev 1736, trunk/gplots/man/plot.lm2.Rd) =================================================================== --- trunk/gplots/man/lmplot2.Rd (rev 0) +++ trunk/gplots/man/lmplot2.Rd 2013-10-15 01:47:31 UTC (rev 1737) @@ -0,0 +1,71 @@ +\name{plot.lm2} +\alias{plot.lm2} +\title{ + Plots to assess the goodness of fit for the linear model objects +} +\description{ + Plots to assess the goodness of fit for the linear model objects + } + \usage{ + plot.lm2( + x, + which = 1:5, + caption = c("Residuals vs Fitted", "Normal Q-Q plot", + "Scale-Location plot", "Cook's distance plot"), + panel = panel.smooth, + sub.caption = deparse(x$call), + main = "", + ask = interactive() && nb.fig < length(which) + && .Device != "postscript", + ..., + id.n = 3, + labels.id = names(residuals(x)), + cex.id = 0.75, + band=TRUE, + rug=TRUE, + width=1/10, + max.n=5000 + ) +} +\arguments{ + \item{x}{lm object} + \item{which}{Numerical values between 1 and 5, indicating which plots + to be shown. The codes are: + + 1- fitted vs residuals plot + 2- Normal Q-Q plot + 3- Scale-Location plot + 4- Cook's distance plot + 5- residuals vs each predictor plot + } + \item{caption}{ Caption for each type of plot} + \item{panel}{ function to draw on the existing plot} + \item{sub.caption}{ SubCaption for the plots } + \item{main}{Main title of the plot} + \item{ask}{whether interactive graphics or postscript } + \item{\dots}{ parameters passed to \code{plot.lm2}. } + \item{id.n}{ integer value, less than or equal to residuals of lm object } + \item{labels.id}{Names of the residuals of the lm object} + \item{cex.id}{Parameter to control the height of text stringsx} + \item{band}{logical vector indicating whether bandplot should also be plotted } + \item{rug}{logical vector indicating whether rug should be added to + the existing plot } + \item{width}{Fraction of the data to use for plot smooths} + \item{max.n}{Maximum number of points to display in plots} +} +\author{Gregory R. Warnes \email{gr...@wa...} and Nitin + Jain \email{nit...@pf...}} +\examples{ +ctl <- rnorm(100, 4) +trt <- rnorm(100, 4.5) +group <- gl(2,100,200, labels=c("Ctl","Trt")) +weight <- c(ctl, trt) +wt.err <- rnorm(length(weight), mean=weight, sd=1/2) +x <- lm(weight ~ group + wt.err) + +plot.lm2(x) + +plot.lm2(x, which=1, width=1/3) +plot.lm2(x, which=1:3, widht=1/3) +} +\keyword{hplot} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-10-15 01:47:00
|
Revision: 1736 http://sourceforge.net/p/r-gregmisc/code/1736 Author: warnes Date: 2013-10-15 01:46:57 +0000 (Tue, 15 Oct 2013) Log Message: ----------- Make boxplot2 manual page from boxplot.n manual page. Added Paths: ----------- trunk/gplots/man/boxplot2.Rd Copied: trunk/gplots/man/boxplot2.Rd (from rev 1735, trunk/gplots/man/boxplot.n.Rd) =================================================================== --- trunk/gplots/man/boxplot2.Rd (rev 0) +++ trunk/gplots/man/boxplot2.Rd 2013-10-15 01:46:57 UTC (rev 1736) @@ -0,0 +1,57 @@ +% $Id$ +% +% $Log$ +% Revision 1.5 2005/12/01 16:46:52 nj7w +% Updated Greg's email address +% +% Revision 1.4 2005/06/09 14:20:28 nj7w +% Updating the version number, and various help files to synchronize splitting of gregmisc bundle in 4 individual components. +% +% Revision 1.1.1.1 2005/05/25 22:15:30 nj7w +% Initial submission as an individual package +% +% Revision 1.3 2002/04/09 00:51:31 warneg +% +% Checkin for version 0.5.3 +% +% Revision 1.2 2001/08/25 05:46:21 warneg +% Added CVS header. +% +% Revision 1.1 2001/08/25 05:45:10 warneg +% Initial Checkin +% +\name{boxplot.n} +\alias{boxplot.n} +\title{Produce a Boxplot Annotated with the Number of Observations} +\description{ + This funcntion uses \code{boxplot} to produce a boxplot which is then + annotated with the number of observations in each group. +} +\usage{ +boxplot.n(..., top=FALSE, shrink=1, textcolor=NULL) +} +\arguments{ + \item{\dots}{ parameters passed to \code{boxplot}. } + \item{top}{ logical indicating whether the number of observations + should be added to the top or the bottom of the plotting + region. Defaults to \code{FALSE}. } + \item{shrink}{ value to shrink character size (cex) when annotating.} + \item{textcolor}{ text color. } +} +\author{ Gregory R. Warnes \email{gr...@wa...}} +\seealso{ \code{\link{boxplot}}, \code{\link{text}}} + +\examples{ +data(state) + +# n's at bottom +boxplot.n( state.area ~ state.region) + +# n's at top +boxplot.n( state.area ~ state.region, top=TRUE) + +# small red text +boxplot.n( state.area ~ state.region, shrink=0.8, textcolor="red") +} + +\keyword{ hplot } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-10-15 01:33:41
|
Revision: 1735 http://sourceforge.net/p/r-gregmisc/code/1735 Author: warnes Date: 2013-10-15 01:33:39 +0000 (Tue, 15 Oct 2013) Log Message: ----------- Create deprecated man page from boxplot.n man page Added Paths: ----------- trunk/gplots/man/gplots-deprecated.Rd Copied: trunk/gplots/man/gplots-deprecated.Rd (from rev 1734, trunk/gplots/man/boxplot.n.Rd) =================================================================== --- trunk/gplots/man/gplots-deprecated.Rd (rev 0) +++ trunk/gplots/man/gplots-deprecated.Rd 2013-10-15 01:33:39 UTC (rev 1735) @@ -0,0 +1,57 @@ +% $Id$ +% +% $Log$ +% Revision 1.5 2005/12/01 16:46:52 nj7w +% Updated Greg's email address +% +% Revision 1.4 2005/06/09 14:20:28 nj7w +% Updating the version number, and various help files to synchronize splitting of gregmisc bundle in 4 individual components. +% +% Revision 1.1.1.1 2005/05/25 22:15:30 nj7w +% Initial submission as an individual package +% +% Revision 1.3 2002/04/09 00:51:31 warneg +% +% Checkin for version 0.5.3 +% +% Revision 1.2 2001/08/25 05:46:21 warneg +% Added CVS header. +% +% Revision 1.1 2001/08/25 05:45:10 warneg +% Initial Checkin +% +\name{boxplot.n} +\alias{boxplot.n} +\title{Produce a Boxplot Annotated with the Number of Observations} +\description{ + This funcntion uses \code{boxplot} to produce a boxplot which is then + annotated with the number of observations in each group. +} +\usage{ +boxplot.n(..., top=FALSE, shrink=1, textcolor=NULL) +} +\arguments{ + \item{\dots}{ parameters passed to \code{boxplot}. } + \item{top}{ logical indicating whether the number of observations + should be added to the top or the bottom of the plotting + region. Defaults to \code{FALSE}. } + \item{shrink}{ value to shrink character size (cex) when annotating.} + \item{textcolor}{ text color. } +} +\author{ Gregory R. Warnes \email{gr...@wa...}} +\seealso{ \code{\link{boxplot}}, \code{\link{text}}} + +\examples{ +data(state) + +# n's at bottom +boxplot.n( state.area ~ state.region) + +# n's at top +boxplot.n( state.area ~ state.region, top=TRUE) + +# small red text +boxplot.n( state.area ~ state.region, shrink=0.8, textcolor="red") +} + +\keyword{ hplot } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-10-12 00:14:42
|
Revision: 1734 http://sourceforge.net/p/r-gregmisc/code/1734 Author: warnes Date: 2013-10-12 00:14:37 +0000 (Sat, 12 Oct 2013) Log Message: ----------- Update NEWS with latest changes Modified Paths: -------------- trunk/gplots/inst/NEWS Modified: trunk/gplots/inst/NEWS =================================================================== --- trunk/gplots/inst/NEWS 2013-10-12 00:09:52 UTC (rev 1733) +++ trunk/gplots/inst/NEWS 2013-10-12 00:14:37 UTC (rev 1734) @@ -9,10 +9,24 @@ Bug Fixes: -- Fix bug in venn diagram code when number of TRUE cases in each - variable are equal. +- Fix error in in venn() when all groups contained the same number of TRUE cases. +- Correct error in overplot() when that occured when a group-category contained no + finite values. +Other Changes: + +- Changes to overplot() to avoid warnings from upcoming enhancements to R CMD check. + +- Move several packages from Depends to Imports or Suggests. + +- Packages caTools and KernSmooth now have namespaces, so import + needed functions in NAMESPACE. + +- Mark one example in manual page for ci2d 'dontrun' to avoid timing + warning in R CMD check. + + Release 2.11.3 - 2013-06-27 --------------------------- @@ -25,9 +39,7 @@ - Fixed typo/spelling error in plotmeans() man page. -Other changes - Release 2.11.2 - 2013-03-24 --------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-10-12 00:09:55
|
Revision: 1733 http://sourceforge.net/p/r-gregmisc/code/1733 Author: warnes Date: 2013-10-12 00:09:52 +0000 (Sat, 12 Oct 2013) Log Message: ----------- Mark one example dontrun to avoid --as-cran warning. Modified Paths: -------------- trunk/gplots/man/ci2d.Rd Modified: trunk/gplots/man/ci2d.Rd =================================================================== --- trunk/gplots/man/ci2d.Rd 2013-10-11 22:09:09 UTC (rev 1732) +++ trunk/gplots/man/ci2d.Rd 2013-10-12 00:09:52 UTC (rev 1733) @@ -256,6 +256,7 @@ #### ## Test with a large number of points #### + \dontrun{ x <- rnorm(60000, sd=1) y <- c( rnorm(40000, mean=x, sd=1), rnorm(20000, mean=x+4, sd=1) ) @@ -263,7 +264,7 @@ hist2d(x,y) ci <- ci2d(x,y) ci - + } } \keyword{dplot} \keyword{hplot} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-10-11 22:09:13
|
Revision: 1732 http://sourceforge.net/p/r-gregmisc/code/1732 Author: warnes Date: 2013-10-11 22:09:09 +0000 (Fri, 11 Oct 2013) Log Message: ----------- Allow standard S3 method handling to locate the correct function. Modified Paths: -------------- trunk/gplots/R/overplot.R Modified: trunk/gplots/R/overplot.R =================================================================== --- trunk/gplots/R/overplot.R 2013-10-11 22:06:20 UTC (rev 1731) +++ trunk/gplots/R/overplot.R 2013-10-11 22:09:09 UTC (rev 1732) @@ -4,10 +4,10 @@ { m <- match.call() - m[[1]] <- graphics:::plot.formula + m[[1]] <- as.name("plot") eval(m, parent.frame() ) - m[[1]] <- gplots:::lowess.formula + m[[1]] <- as.name("lowess") tmp <- eval(m, parent.frame() ) lines( tmp, col=col, lwd=2, lty=lty ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-10-11 22:06:22
|
Revision: 1731 http://sourceforge.net/p/r-gregmisc/code/1731 Author: warnes Date: 2013-10-11 22:06:20 +0000 (Fri, 11 Oct 2013) Log Message: ----------- Fix error when a subgroup contains no finite values Modified Paths: -------------- trunk/gplots/R/overplot.R Modified: trunk/gplots/R/overplot.R =================================================================== --- trunk/gplots/R/overplot.R 2013-10-11 21:20:55 UTC (rev 1730) +++ trunk/gplots/R/overplot.R 2013-10-11 22:06:20 UTC (rev 1731) @@ -151,6 +151,10 @@ mycall$lty = i tmp.y <- y[mycall$subset & cond==level] + + ## If nothing to plot, skip to next level + if(!any(is.finite(tmp.y))) next + min.tmp.y <- min(tmp.y, na.rm=TRUE) max.tmp.y <- max(tmp.y, na.rm=TRUE) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-10-11 21:20:58
|
Revision: 1730 http://sourceforge.net/p/r-gregmisc/code/1730 Author: warnes Date: 2013-10-11 21:20:55 +0000 (Fri, 11 Oct 2013) Log Message: ----------- Update test output Modified Paths: -------------- trunk/gplots/tests/heatmap2Test.Rout.save Modified: trunk/gplots/tests/heatmap2Test.Rout.save =================================================================== --- trunk/gplots/tests/heatmap2Test.Rout.save 2013-10-11 21:08:34 UTC (rev 1729) +++ trunk/gplots/tests/heatmap2Test.Rout.save 2013-10-11 21:20:55 UTC (rev 1730) @@ -1,5 +1,5 @@ -R version 3.0.1 (2013-05-16) -- "Good Sport" +R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: i686-pc-linux-gnu (32-bit) @@ -16,28 +16,8 @@ Type 'q()' to quit R. > library(gplots) -Loading required package: gtools -Loading required package: gdata -gdata: read.xls support for 'XLS' (Excel 97-2004) files ENABLED. - -gdata: read.xls support for 'XLSX' (Excel 2007+) files ENABLED. - -Attaching package: 'gdata' - -The following object is masked from 'package:stats': - - nobs - -The following object is masked from 'package:utils': - - object.size - -Loading required package: caTools -Loading required package: grid -Loading required package: KernSmooth KernSmooth 2.23 loaded Copyright M. P. Wand 1997-2009 -Loading required package: MASS Attaching package: 'gplots' @@ -244,4 +224,4 @@ > > proc.time() user system elapsed - 5.104 0.356 5.478 + 4.852 0.372 5.389 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-10-11 21:08:37
|
Revision: 1729 http://sourceforge.net/p/r-gregmisc/code/1729 Author: warnes Date: 2013-10-11 21:08:34 +0000 (Fri, 11 Oct 2013) Log Message: ----------- Move several packages from Depends to Imports, Suggests Modified Paths: -------------- trunk/gplots/DESCRIPTION Modified: trunk/gplots/DESCRIPTION =================================================================== --- trunk/gplots/DESCRIPTION 2013-10-11 21:07:30 UTC (rev 1728) +++ trunk/gplots/DESCRIPTION 2013-10-11 21:08:34 UTC (rev 1729) @@ -1,9 +1,9 @@ Package: gplots Title: Various R programming tools for plotting data Description: Various R programming tools for plotting data -Depends: R (>= 3.0), gtools, gdata, stats, caTools, grid, KernSmooth, - MASS, datasets -Suggests: gtools, grid +Depends: R (>= 3.0) +Imports: gtools, gdata, stats, caTools, KernSmooth +Suggests: grid, MASS Version: 2.12.0 Date: 2013-10-11 Author: Gregory R. Warnes, Ben Bolker, Lodewijk Bonebakker, Robert This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-10-11 21:07:32
|
Revision: 1728 http://sourceforge.net/p/r-gregmisc/code/1728 Author: warnes Date: 2013-10-11 21:07:30 +0000 (Fri, 11 Oct 2013) Log Message: ----------- Use gdata::nobs in example Modified Paths: -------------- trunk/gplots/man/ci2d.Rd Modified: trunk/gplots/man/ci2d.Rd =================================================================== --- trunk/gplots/man/ci2d.Rd 2013-10-11 21:03:34 UTC (rev 1727) +++ trunk/gplots/man/ci2d.Rd 2013-10-11 21:07:30 UTC (rev 1728) @@ -208,7 +208,7 @@ sd.x <- sd(geyser$duration) sd.y <- sd(geyser$waiting) - t.value <- qt(c(0.05,0.95), df=nobs(geyser$duration), lower=TRUE) + t.value <- qt(c(0.05,0.95), df=gdata::nobs(geyser$duration), lower=TRUE) ci.x <- mean.x + t.value* sd.x ci.y <- mean.y + t.value* sd.y This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-10-11 21:03:36
|
Revision: 1727 http://sourceforge.net/p/r-gregmisc/code/1727 Author: warnes Date: 2013-10-11 21:03:34 +0000 (Fri, 11 Oct 2013) Log Message: ----------- caTools and KernSmooth now have namespaces, so import from them. Modified Paths: -------------- trunk/gplots/NAMESPACE Modified: trunk/gplots/NAMESPACE =================================================================== --- trunk/gplots/NAMESPACE 2013-10-11 20:24:57 UTC (rev 1726) +++ trunk/gplots/NAMESPACE 2013-10-11 21:03:34 UTC (rev 1727) @@ -40,12 +40,12 @@ importFrom(stats, na.omit) # No Namespace -#importFrom(caTools, runsd) -#importFrom(caTools, runmean) +importFrom(caTools, runsd) +importFrom(caTools, runmean) # No Namespace -#importFrom(KernSmooth, bkdeD2) -#importFrom(KernSmooth, dpik) +importFrom(KernSmooth, bkde2D) +importFrom(KernSmooth, dpik) S3method(balloonplot,default) S3method(balloonplot,table) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |