[R-gregmisc-users] SF.net SVN: r-gregmisc:[1365] trunk/gplots
Brought to you by:
warnes
From: <wa...@us...> - 2009-11-12 15:39:01
|
Revision: 1365 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1365&view=rev Author: warnes Date: 2009-11-12 15:38:53 +0000 (Thu, 12 Nov 2009) Log Message: ----------- Correct bug reported by Alan Yong: plotmeans() crashed when 'bars=FALSE'. Modified Paths: -------------- trunk/gplots/DESCRIPTION trunk/gplots/R/plotmeans.R trunk/gplots/inst/NEWS Added Paths: ----------- trunk/gplots/tests/plotmeans_nobars.R Modified: trunk/gplots/DESCRIPTION =================================================================== --- trunk/gplots/DESCRIPTION 2009-10-22 20:53:11 UTC (rev 1364) +++ trunk/gplots/DESCRIPTION 2009-11-12 15:38:53 UTC (rev 1365) @@ -4,7 +4,7 @@ Depends: gtools, gdata, stats, caTools, grid Recommends: datasets, grid Suggests: gtools -Version: 2.7.3 +Version: 2.7.4 Author: Gregory R. Warnes. Includes R source code and/or documentation contributed by (in alphabetical order): Ben Bolker, Lodewijk Bonebakker, Robert Gentleman, Wolfgang Modified: trunk/gplots/R/plotmeans.R =================================================================== --- trunk/gplots/R/plotmeans.R 2009-10-22 20:53:11 UTC (rev 1364) +++ trunk/gplots/R/plotmeans.R 2009-11-12 15:38:53 UTC (rev 1365) @@ -59,8 +59,12 @@ mf[,i] <- factor(mf[,i]) means <- sapply(split(mf[[response]], mf[[-response]]), mean, na.rm=TRUE) + ns <- sapply(sapply(split(mf[[response]], mf[[-response]]), na.omit, + simplify=FALSE), length ) xlim <- c(0.5, length(means)+0.5) + + if(!bars) { plot( means, ..., col=col, xlim=xlim) @@ -69,12 +73,9 @@ { myvar <- function(x) var(x[!is.na(x)]) - vars <- sapply(split(mf[[response]], mf[[-response]]), myvar) - ns <- sapply( sapply(split(mf[[response]], mf[[-response]]), na.omit, - simplify=FALSE), length ) - # apply minimum variance specified by minsd^2 + ## apply minimum variance specified by minsd^2 vars <- ifelse( vars < (minsd^2), (minsd^2), vars) if(use.t) Modified: trunk/gplots/inst/NEWS =================================================================== --- trunk/gplots/inst/NEWS 2009-10-22 20:53:11 UTC (rev 1364) +++ trunk/gplots/inst/NEWS 2009-11-12 15:38:53 UTC (rev 1365) @@ -1,3 +1,10 @@ +Release 2.7.4 - 2009-11-12 +-------------------------- + +Bug Fixes: + +- Correct bug reported by Alan Yong: plotmeans() failed when bars=FALSE. + Release 2.7.3 - 2009-10-22 -------------------------- Added: trunk/gplots/tests/plotmeans_nobars.R =================================================================== --- trunk/gplots/tests/plotmeans_nobars.R (rev 0) +++ trunk/gplots/tests/plotmeans_nobars.R 2009-11-12 15:38:53 UTC (rev 1365) @@ -0,0 +1,7 @@ +## Test that plotmeans works properly when bars=F +## Bug repoted by Alan Yong, Research Geophysicist, +## US DEPARTMENT OF THE INTERIOR + +library(gplots) +data(state) +plotmeans(state.area ~ state.region, bars=FALSE) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |