r-gregmisc-users Mailing List for R gregmisc package (Page 4)
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...> - 2015-04-23 22:55:45
|
Revision: 1954 http://sourceforge.net/p/r-gregmisc/code/1954 Author: warnes Date: 2015-04-23 22:55:43 +0000 (Thu, 23 Apr 2015) Log Message: ----------- In heatmap.2(), the color key now properly handles color breaks that are not equally spaced. (Issue reported by Tim Richter-Heitmann.) Modified Paths: -------------- trunk/gplots/DESCRIPTION trunk/gplots/R/heatmap.2.R trunk/gplots/inst/ChangeLog trunk/gplots/inst/NEWS Modified: trunk/gplots/DESCRIPTION =================================================================== --- trunk/gplots/DESCRIPTION 2015-04-23 22:49:10 UTC (rev 1953) +++ trunk/gplots/DESCRIPTION 2015-04-23 22:55:43 UTC (rev 1954) @@ -5,7 +5,7 @@ Imports: gtools, gdata, stats, caTools, KernSmooth Suggests: grid, MASS Version: 2.17.0 -Date: 2015-04-21 +Date: 2015-04-23 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/R/heatmap.2.R =================================================================== --- trunk/gplots/R/heatmap.2.R 2015-04-23 22:49:10 UTC (rev 1953) +++ trunk/gplots/R/heatmap.2.R 2015-04-23 22:55:43 UTC (rev 1954) @@ -198,8 +198,8 @@ nr <- length(rowInd) } else if (is.integer(Rowv)) - { ## Compute dendrogram and do reordering based on given vector - browser() + { + ## Compute dendrogram and do reordering based on given vector distr <- distfun(x) hcr <- hclustfun(distr) ddr <- as.dendrogram(hcr) @@ -641,7 +641,7 @@ max.raw <- max.breaks } - z <- seq(min.raw, max.raw, length=length(col)) + z <- seq(min.raw, max.raw, by=min(diff(breaks)/4)) image(z=matrix(z, ncol=1), col=col, breaks=tmpbreaks, xaxt="n", yaxt="n") @@ -670,10 +670,11 @@ if(density.info=="density") { - dens <- density(x, adjust=densadj, na.rm=TRUE) + dens <- density(x, adjust=densadj, na.rm=TRUE, + from=min.scale, to=max.scale) omit <- dens$x < min(breaks) | dens$x > max(breaks) - dens$x <- dens$x[-omit] - dens$y <- dens$y[-omit] + dens$x <- dens$x[!omit] + dens$y <- dens$y[!omit] dens$x <- scale01(dens$x, min.raw, max.raw) lines(dens$x, dens$y / max(dens$y) * 0.95, col=denscol, lwd=1) if (is.null(key.ytickfun)) { Modified: trunk/gplots/inst/ChangeLog =================================================================== --- trunk/gplots/inst/ChangeLog 2015-04-23 22:49:10 UTC (rev 1953) +++ trunk/gplots/inst/ChangeLog 2015-04-23 22:55:43 UTC (rev 1954) @@ -1,5 +1,36 @@ +2015-04-23 warnes + + * [r1948] R/plotCI.R: - plotCI() was not properly respecting the + 'type=' argument. This has + been corrected. + * [r1947] R/overplot.R: - Remove stray browser() call from + overplot() + * [r1943] man/balloonplot.Rd: Explicitly specify argument to + gplots:::reorder.factor to prevent error. + * [r1942] R/venn.R, man/venn.Rd: - The returned object from venn() + now includes a 'interesection' + attribution containing a list of which items are in each set + intersection. This can be turned off by settting + 'intersection=FALSE'. + * [r1941] R/heatmap.2.R: Patch submitted by Ilia Kats: + - easily extract and plot subclusters from a big heatmap using + the + same colorkey, by passing a dendgrogram of the subcluster + together + with the full data matrix and, optionally, the breaks of the full + heatmap in order to obtain the same color scaling. This is useful + if + one wants to plot several subclusters as different panels in a + paper, but maintain consistent color coding. + - Improves the behavior of the color key axis labels, as they now + honor par("cex") and par("cex.lab"). + * [r1940] R/heatmap.2.R: In heatmap.2() split calls to distfun() + and hclustfun() into separate steps to make debugging easier + 2015-04-22 warnes + * [r1931] DESCRIPTION, inst/ChangeLog, inst/NEWS: Update + DESCRIPTION, ChangeLog, and NEWS for gplots 2.17.0 * [r1930] R/heatmap.2.R, man/heatmap.2.Rd: heatmap.2: add new 'colRow' and 'colCol' arguments to control the color of row and column text labels Modified: trunk/gplots/inst/NEWS =================================================================== --- trunk/gplots/inst/NEWS 2015-04-23 22:49:10 UTC (rev 1953) +++ trunk/gplots/inst/NEWS 2015-04-23 22:55:43 UTC (rev 1954) @@ -1,4 +1,4 @@ -Release 2.17.0 - 2015-04-21 +Release 2.17.0 - 2015-04-23 --------------------------- New Features: @@ -6,7 +6,30 @@ - heatmap.2() has two new arguments, 'colRow' and 'colCol' to control the color of row and column text labels. +- heatmap.2() has been modified to make it easier to extract and plot + subclusters from a large heatmap. Simply pass the dendrogram of the + subcluster together with the full data matrix and, optionally, the + breaks of the full heatmap in order to obtain the same color + scaling. (Patch contributed by Ilia Kats.) +- venn() now returns a list of the members of each set intersection in + the attribute 'intersections'. This can be disabled using the + argument 'intersection=FALSE' (Patch by Steffen Möller.) + +Bug Fixes: + +- plotCI() now properly respects the 'type=' argument. (Bug report + and correction by Wiktor Żelazny.) + +- Remove stray browser() call from overplot() + +- In the balloonplot() examples, explicitly specify argument to + gplots:::reorder.factor to prevent error. + +Other Changes: + +- Remove stray browser() call from + Release 2.16.0 - 2015-01-02 --------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2015-04-23 22:49:12
|
Revision: 1953 http://sourceforge.net/p/r-gregmisc/code/1953 Author: warnes Date: 2015-04-23 22:49:10 +0000 (Thu, 23 Apr 2015) Log Message: ----------- Update NEWS and ChangeLog Modified Paths: -------------- trunk/gdata/inst/ChangeLog trunk/gdata/inst/NEWS Modified: trunk/gdata/inst/ChangeLog =================================================================== --- trunk/gdata/inst/ChangeLog 2015-04-23 22:41:46 UTC (rev 1952) +++ trunk/gdata/inst/ChangeLog 2015-04-23 22:49:10 UTC (rev 1953) @@ -1,5 +1,11 @@ 2015-04-23 warnes + * [r1952] R/write.fwf.R: - write.fwf() now properly supports + matrix objects, including matrix objects wihtout column + names. (Reported by Carl Witthoft.) + * [r1951] inst/perl/xls2csv.pl: Remove 'use POSIX' from xls2csv.pl + since it is no longer needed + * [r1939] inst/ChangeLog, inst/NEWS: Update NEWS and ChangeLog * [r1938] R/reorder.R: reorder.factor() now hands off processing to stats:::reorder.default() when either 'X' or 'FUN' is specified. Modified: trunk/gdata/inst/NEWS =================================================================== --- trunk/gdata/inst/NEWS 2015-04-23 22:41:46 UTC (rev 1952) +++ trunk/gdata/inst/NEWS 2015-04-23 22:49:10 UTC (rev 1953) @@ -29,15 +29,21 @@ and providing either 'X' or 'FUN' causes processing to be handed off to stats:::reorder.defailt() so will return the same results whether gdata is loaded or not. (Reported by Sam Hunter.) + +- write.fwf() now properly supports matrix objects, including matrix + objects without column names. (Reported by Carl Witthoft.) Other changes: -- Replaced depricated PERL function POSIX::isdigit with equivalent regular - expression. +- Replaced depricated PERL function POSIX::isdigit in xls2csv.pl + (which is used by read.xls() ) with an equivalent regular + expression. (Reported by both Charles Plessy, Gerrit-jan Schutten, + and Paul Johnson. Charles also provided a patch to correct the + issue.) - object.size() now returns objects with S3 class 'object_sizes' (note the final 's') to avoid conflicts with methods in utils for class 'object_size' - which can only handle a scalar size. + provided by package 'utils' which can only handle a scalar size. Changes in 2.14.0 (2014-08-27) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2015-04-23 22:41:49
|
Revision: 1952 http://sourceforge.net/p/r-gregmisc/code/1952 Author: warnes Date: 2015-04-23 22:41:46 +0000 (Thu, 23 Apr 2015) Log Message: ----------- - write.fwf() now properly supports matrix objects, including matrix objects wihtout column names. (Reported by Carl Witthoft.) Modified Paths: -------------- trunk/gdata/R/write.fwf.R Modified: trunk/gdata/R/write.fwf.R =================================================================== --- trunk/gdata/R/write.fwf.R 2015-04-23 21:55:42 UTC (rev 1951) +++ trunk/gdata/R/write.fwf.R 2015-04-23 22:41:46 UTC (rev 1952) @@ -44,6 +44,8 @@ colnames(x)[1] <- rowColVal } colnamesMy <- colnames(x) + if(length(colnamesMy)==0) + colnamesMy <- paste( "V", 1:ncol(x), sep="") nRow <- nrow(x) nCol <- length(colnamesMy) @@ -67,18 +69,20 @@ stringsAsFactors=FALSE) ## Which columns are numeric like - isNum <- sapply(x, is.numeric) + isNum <- apply(x, 2, is.numeric) ## is.numeric picks also Date and POSIXt - isNum <- isNum & !(sapply(x, inherits, what="Date") | - sapply(x, inherits, what="POSIXt")) + isNum <- isNum & !(apply(x, 2, inherits, what="Date") | + apply(x, 2, inherits, what="POSIXt")) ## Which columns are factors --> convert them to character - isFac <- sapply(x, is.factor) - x[, isFac] <- lapply(x[, isFac, drop=FALSE], as.character) + isFac <- apply(x, 2, is.factor) + x[, isFac] <- apply(x[, isFac, drop=FALSE], 2, as.character) ## Collect information about how format() will format columns. ## We need to get this info now, since format will turn all columns to character - tmp <- lapply(x, format.info, ...) +browser() + + tmp <- apply(x, 2, format.info, ...) tmp1 <- sapply(tmp, length) tmp <- t(as.data.frame(tmp)) retFormat$width <- tmp[, 1] @@ -137,7 +141,7 @@ ## Number of levels for "non-numeric"" columns if(any(!isNum)) { - retFormat[!isNum, "nlevels"] <- sapply(x[, !isNum, drop=FALSE], + retFormat[!isNum, "nlevels"] <- apply(x[, !isNum, drop=FALSE], 2, function(z) length(unique(z))) } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2015-04-23 21:55:49
|
Revision: 1951 http://sourceforge.net/p/r-gregmisc/code/1951 Author: warnes Date: 2015-04-23 21:55:42 +0000 (Thu, 23 Apr 2015) Log Message: ----------- Remove 'use POSIX' from xls2csv.pl since it is no longer needed Modified Paths: -------------- trunk/gdata/inst/perl/xls2csv.pl Modified: trunk/gdata/inst/perl/xls2csv.pl =================================================================== --- trunk/gdata/inst/perl/xls2csv.pl 2015-04-23 21:53:19 UTC (rev 1950) +++ trunk/gdata/inst/perl/xls2csv.pl 2015-04-23 21:55:42 UTC (rev 1951) @@ -9,7 +9,6 @@ use strict; #use Spreadsheet::ParseExcel; #use Spreadsheet::ParseXLSX; -use POSIX; use File::Spec::Functions; use Getopt::Std; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2015-04-23 21:53:26
|
Revision: 1950 http://sourceforge.net/p/r-gregmisc/code/1950 Author: warnes Date: 2015-04-23 21:53:19 +0000 (Thu, 23 Apr 2015) Log Message: ----------- Update NEWS and ChangeLog Modified Paths: -------------- trunk/gtools/inst/ChangeLog trunk/gtools/inst/NEWS Modified: trunk/gtools/inst/ChangeLog =================================================================== --- trunk/gtools/inst/ChangeLog 2015-04-23 21:47:48 UTC (rev 1949) +++ trunk/gtools/inst/ChangeLog 2015-04-23 21:53:19 UTC (rev 1950) @@ -1,5 +1,12 @@ 2015-04-23 warnes + * [r1949] R/quantcut.R, man/quantcut.Rd: - The 'q' argument to + quantcut()'s 'q' now accept an integer + indicating the number of equally spaced quantile groups to + create. (Suggestion and patch submitted by Ryan C. Thompson.) + * [r1946] DESCRIPTION: Revers accidental text deletion: + * [r1945] DESCRIPTION, inst/ChangeLog, inst/NEWS: Update for gtools + 3.4.3 * [r1944] R/smartbind.R, R/strmacro.R: Remove debugging code and stray browser() call Modified: trunk/gtools/inst/NEWS =================================================================== --- trunk/gtools/inst/NEWS 2015-04-23 21:47:48 UTC (rev 1949) +++ trunk/gtools/inst/NEWS 2015-04-23 21:53:19 UTC (rev 1950) @@ -1,6 +1,12 @@ gtools 3.4.3 - 2015-04-06 ------------------------- +Enhancements: + +- The 'q' argument to quantcut() now accept an integer + indicating the number of equally spaced quantile groups to + create. (Suggestion and patch submitted by Ryan C. Thompson.) + Bug fixes: - Removed stray browser() call in smartbind(). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2015-04-23 21:47:51
|
Revision: 1949 http://sourceforge.net/p/r-gregmisc/code/1949 Author: warnes Date: 2015-04-23 21:47:48 +0000 (Thu, 23 Apr 2015) Log Message: ----------- - The 'q' argument to quantcut()'s 'q' now accept an integer indicating the number of equally spaced quantile groups to create. (Suggestion and patch submitted by Ryan C. Thompson.) Modified Paths: -------------- trunk/gtools/R/quantcut.R trunk/gtools/man/quantcut.Rd Modified: trunk/gtools/R/quantcut.R =================================================================== --- trunk/gtools/R/quantcut.R 2015-04-23 21:23:36 UTC (rev 1948) +++ trunk/gtools/R/quantcut.R 2015-04-23 21:47:48 UTC (rev 1949) @@ -1,7 +1,10 @@ # $Id$ -quantcut <- function(x, q=seq(0,1,by=0.25), na.rm=TRUE, ... ) +quantcut <- function(x, q=4, na.rm=TRUE, ... ) { + if(length(q)==1) + q <- seq(0,1, length.out=q+1) + quant <- quantile(x, q, na.rm=na.rm) dups <- duplicated(quant) if(any(dups)) Modified: trunk/gtools/man/quantcut.Rd =================================================================== --- trunk/gtools/man/quantcut.Rd 2015-04-23 21:23:36 UTC (rev 1948) +++ trunk/gtools/man/quantcut.Rd 2015-04-23 21:47:48 UTC (rev 1949) @@ -13,8 +13,10 @@ %- maybe also `usage' for other objects documented here. \arguments{ \item{x}{ Continous variable. } - \item{q}{ Vector of quantiles used for creating groups. Defaults to - \code{seq(0, 1, by=0.25)}. See \code{\link{quantile}} for details. } + \item{q}{ Either a integer number of equally spaced quantile groups to + create, or a vector of quantiles used for creating groups. Defaults to + \code{q=4} which is equivalent to \code{q=seq(0, 1, by=0.25)}. + See \code{\link{quantile}} for details. } \item{na.rm}{ Boolean indicating whether missing values should be removed when computing quantiles. Defaults to TRUE.} \item{\dots}{ Optional arguments passed to \code{\link{cut}}. } @@ -31,7 +33,7 @@ of quantile intervals. } \value{ - Factor variable with one level for each quantile interval given by \code{q}. + Factor variable with one level for each quantile interval. } \author{Gregory R. Warnes \email{gr...@wa...}} @@ -51,13 +53,19 @@ table(quartiles) ## cut into deciles - deciles <- quantcut( x, seq(0,1,by=0.1) ) - table(deciles) + deciles.1 <- quantcut( x, 10 ) + table(deciles.1) + # or equivalently + deciles.2 <- quantcut( x, seq(0,1,by=0.1) ) + \testonly{ + stopifnot(identical(deciles.1, deciles.2)) + } + ## show handling of 'tied' quantiles. x <- round(x) # discretize to create ties stem(x) # display the ties - deciles <- quantcut( x, seq(0,1,by=0.1) ) + deciles <- quantcut( x, 10 ) table(deciles) # note that there are only 5 groups (not 10) # due to duplicates This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2015-04-23 21:23:43
|
Revision: 1948 http://sourceforge.net/p/r-gregmisc/code/1948 Author: warnes Date: 2015-04-23 21:23:36 +0000 (Thu, 23 Apr 2015) Log Message: ----------- - plotCI() was not properly respecting the 'type=' argument. This has been corrected. Modified Paths: -------------- trunk/gplots/R/plotCI.R Modified: trunk/gplots/R/plotCI.R =================================================================== --- trunk/gplots/R/plotCI.R 2015-04-23 21:18:42 UTC (rev 1947) +++ trunk/gplots/R/plotCI.R 2015-04-23 21:23:36 UTC (rev 1948) @@ -103,7 +103,7 @@ { if(invalid(labels) || labels==FALSE ) plot(x, y, ylim = ylim, xlim=xlim, col=col, - xlab=xlab, ylab=ylab, ...) + xlab=xlab, ylab=ylab, type="n", ...) else { plot(x, y, ylim = ylim, xlim=xlim, col=col, type="n", This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2015-04-23 21:18:49
|
Revision: 1947 http://sourceforge.net/p/r-gregmisc/code/1947 Author: warnes Date: 2015-04-23 21:18:42 +0000 (Thu, 23 Apr 2015) Log Message: ----------- - Remove stray browser() call from overplot() Modified Paths: -------------- trunk/gplots/R/overplot.R Modified: trunk/gplots/R/overplot.R =================================================================== --- trunk/gplots/R/overplot.R 2015-04-23 21:10:33 UTC (rev 1946) +++ trunk/gplots/R/overplot.R 2015-04-23 21:18:42 UTC (rev 1947) @@ -58,8 +58,6 @@ x.all.min <- min(x, na.rm=TRUE) x.all.max <- max(x, na.rm=TRUE) - if(y.all.min==y.all.max) browser() - if (length(cond) == 0) { cond <- list(as.factor(rep(1, length(x)))) } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2015-04-23 21:10:41
|
Revision: 1946 http://sourceforge.net/p/r-gregmisc/code/1946 Author: warnes Date: 2015-04-23 21:10:33 +0000 (Thu, 23 Apr 2015) Log Message: ----------- Revers accidental text deletion: Modified Paths: -------------- trunk/gtools/DESCRIPTION Modified: trunk/gtools/DESCRIPTION =================================================================== --- trunk/gtools/DESCRIPTION 2015-04-23 21:09:19 UTC (rev 1945) +++ trunk/gtools/DESCRIPTION 2015-04-23 21:10:33 UTC (rev 1946) @@ -1,3 +1,26 @@ +Package: gtools +Title: Various R Programming Tools +Description: Functions to assist in R programming, including: + - assist in developing, updating, and maintaining R and R packages ('ask', 'checkRVersion', + 'getDependencies', 'keywords', 'scat'), + - calculate the logit and inverse logit transformations ('logit', 'inv.logit'), + - test if a value is missing, empty or contains only NA and NULL values ('invalid'), + - manipulate R's .Last function ('addLast'), + - define macros ('defmacro'), + - detect odd and even integers ('odd', 'even'), + - convert strings containing non-ASCII characters (like single quotes) to plain ASCII ('ASCIIfy'), + - perform a binary search ('binsearch'), + - sort strings containing both numeric and character components ('mixedsort'), + - create a factor variable from the quantiles of a continuous variable ('quantcut'), + - enumerate permutations and combinations ('combinations', 'permutation'), + - calculate and convert between fold-change and log-ratio ('foldchange', + 'logratio2foldchange', 'foldchange2logratio'), + - calculate probabilities and generate random numbers from Dirichlet distributions + ('rdirichlet', 'ddirichlet'), + - apply a function over adjacent subsets of a vector ('running'), + - Modify the TCP\_NODELAY ('de-Nagle') flag for socket objects, + - Efficient 'rbind' of data frames, even if the column names don't match ('smartbind'), + - Generate significance stars from p-values ('stars.pval'). Version: 3.4.3 Date: 2015-04-23 Author: Gregory R. Warnes, Ben Bolker, and Thomas Lumley This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2015-04-23 21:09:21
|
Revision: 1945 http://sourceforge.net/p/r-gregmisc/code/1945 Author: warnes Date: 2015-04-23 21:09:19 +0000 (Thu, 23 Apr 2015) Log Message: ----------- Update for gtools 3.4.3 Modified Paths: -------------- trunk/gtools/DESCRIPTION trunk/gtools/inst/ChangeLog trunk/gtools/inst/NEWS Modified: trunk/gtools/DESCRIPTION =================================================================== --- trunk/gtools/DESCRIPTION 2015-04-23 21:06:19 UTC (rev 1944) +++ trunk/gtools/DESCRIPTION 2015-04-23 21:09:19 UTC (rev 1945) @@ -1,28 +1,5 @@ -Package: gtools -Title: Various R Programming Tools -Description: Functions to assist in R programming, including: - - assist in developing, updating, and maintaining R and R packages ('ask', 'checkRVersion', - 'getDependencies', 'keywords', 'scat'), - - calculate the logit and inverse logit transformations ('logit', 'inv.logit'), - - test if a value is missing, empty or contains only NA and NULL values ('invalid'), - - manipulate R's .Last function ('addLast'), - - define macros ('defmacro'), - - detect odd and even integers ('odd', 'even'), - - convert strings containing non-ASCII characters (like single quotes) to plain ASCII ('ASCIIfy'), - - perform a binary search ('binsearch'), - - sort strings containing both numeric and character components ('mixedsort'), - - create a factor variable from the quantiles of a continuous variable ('quantcut'), - - enumerate permutations and combinations ('combinations', 'permutation'), - - calculate and convert between fold-change and log-ratio ('foldchange', - 'logratio2foldchange', 'foldchange2logratio'), - - calculate probabilities and generate random numbers from Dirichlet distributions - ('rdirichlet', 'ddirichlet'), - - apply a function over adjacent subsets of a vector ('running'), - - Modify the TCP\_NODELAY ('de-Nagle') flag for socket objects, - - Efficient 'rbind' of data frames, even if the column names don't match ('smartbind'), - - Generate significance stars from p-values ('stars.pval'). -Version: 3.4.2 -Date: 2015-04-06 +Version: 3.4.3 +Date: 2015-04-23 Author: Gregory R. Warnes, Ben Bolker, and Thomas Lumley Maintainer: Gregory R. Warnes <gr...@wa...> License: LGPL-2.1 Modified: trunk/gtools/inst/ChangeLog =================================================================== --- trunk/gtools/inst/ChangeLog 2015-04-23 21:06:19 UTC (rev 1944) +++ trunk/gtools/inst/ChangeLog 2015-04-23 21:09:19 UTC (rev 1945) @@ -1,5 +1,15 @@ +2015-04-23 warnes + + * [r1944] R/smartbind.R, R/strmacro.R: Remove debugging code and + stray browser() call + +2015-04-14 warnes + + * [r1923] DESCRIPTION: Fix typo + 2015-04-09 warnes + * [r1921] inst/ChangeLog: Update gtools ChangeLog * [r1920] DESCRIPTION, NAMESPACE, R/loadedPackages.R, R/na.replace.R, inst/ChangeLog, inst/NEWS, man/loadedPackages.Rd, man/na.replace.Rd: Move first()/last()/left()/right() to gdata. Modified: trunk/gtools/inst/NEWS =================================================================== --- trunk/gtools/inst/NEWS 2015-04-23 21:06:19 UTC (rev 1944) +++ trunk/gtools/inst/NEWS 2015-04-23 21:09:19 UTC (rev 1945) @@ -1,3 +1,15 @@ +gtools 3.4.3 - 2015-04-06 +------------------------- + +Bug fixes: + +- Removed stray browser() call in smartbind(). + +Other changes: + +- Correct typographical errors in package description. + + gtools 3.4.2 - 2015-04-06 ------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2015-04-23 21:06:22
|
Revision: 1944 http://sourceforge.net/p/r-gregmisc/code/1944 Author: warnes Date: 2015-04-23 21:06:19 +0000 (Thu, 23 Apr 2015) Log Message: ----------- Remove debugging code and stray browser() call Modified Paths: -------------- trunk/gtools/R/smartbind.R trunk/gtools/R/strmacro.R Modified: trunk/gtools/R/smartbind.R =================================================================== --- trunk/gtools/R/smartbind.R 2015-04-23 20:21:21 UTC (rev 1943) +++ trunk/gtools/R/smartbind.R 2015-04-23 21:06:19 UTC (rev 1944) @@ -167,7 +167,6 @@ if(length(colClass)>1) # not just plain factor { - browser() warning( "column '", col, "' of class ", paste("'", colClass, "'", collapse=":", sep="'"), Modified: trunk/gtools/R/strmacro.R =================================================================== --- trunk/gtools/R/strmacro.R 2015-04-23 20:21:21 UTC (rev 1943) +++ trunk/gtools/R/strmacro.R 2015-04-23 21:06:19 UTC (rev 1944) @@ -22,11 +22,6 @@ { a[[i]] <- a[[i]] } - #if (nn[i] == "DOTS") - # { - # nn[i] <- "..." - # a[[i]] <- formals(function(...){})[[1]] - # } } names(a) <- nn a <- as.list(a) @@ -38,28 +33,12 @@ ## build replacement list reptab <- a # copy defaults first reptab$"..." <- NULL - #reptab$DOTS <- "" args <- match.call(expand.dots=TRUE)[-1] - #print(args) for(item in names(args)) - ##if(item %in% names(reptab)) reptab[[item]] <- args[[item]] - ##else - ## { - ## browser() - ## oldval <- reptab[["DOTS"]] - ## addval <- paste(item, "=", args[[item]]) - ## if(oldval>"") - ## newval <- paste(c(oldval, addval), collapse=", ") - ## else - ## newval <- addval - ## reptab[["DOTS"]] <- newval - ## } - #print(reptab) - ## do the replacements body <- strexpr for(i in 1:length(reptab)) @@ -77,8 +56,6 @@ body) } - #print(body) - fun <- parse(text=body) eval(fun, parent.frame()) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2015-04-23 20:21:23
|
Revision: 1943 http://sourceforge.net/p/r-gregmisc/code/1943 Author: warnes Date: 2015-04-23 20:21:21 +0000 (Thu, 23 Apr 2015) Log Message: ----------- Explicitly specify argument to gplots:::reorder.factor to prevent error. Modified Paths: -------------- trunk/gplots/man/balloonplot.Rd Modified: trunk/gplots/man/balloonplot.Rd =================================================================== --- trunk/gplots/man/balloonplot.Rd 2015-04-23 19:58:44 UTC (rev 1942) +++ trunk/gplots/man/balloonplot.Rd 2015-04-23 20:21:21 UTC (rev 1943) @@ -172,7 +172,8 @@ balloonplot(x=list(Age,Sex), y=list(Class=Class, - Survived=gdata::reorder.factor(Survived,c(2,1))), + Survived=gdata::reorder.factor(Survived,new.order=c(2,1)) + ), z=Freq, zlab="Number of Passengers", sort=TRUE, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2015-04-23 19:58:51
|
Revision: 1942 http://sourceforge.net/p/r-gregmisc/code/1942 Author: warnes Date: 2015-04-23 19:58:44 +0000 (Thu, 23 Apr 2015) Log Message: ----------- - The returned object from venn() now includes a 'interesection' attribution containing a list of which items are in each set intersection. This can be turned off by settting 'intersection=FALSE'. Modified Paths: -------------- trunk/gplots/R/venn.R trunk/gplots/man/venn.Rd Modified: trunk/gplots/R/venn.R =================================================================== --- trunk/gplots/R/venn.R 2015-04-23 19:09:17 UTC (rev 1941) +++ trunk/gplots/R/venn.R 2015-04-23 19:58:44 UTC (rev 1942) @@ -1,7 +1,7 @@ # This code plots Venn Diagrams for up to 5 sets. The # function getVennCounts is passed a list of vectors. # This is transformed into a table indicating the -# number of members for each intersection. This table +# number of intersections for each intersection. This table # is generated for any number of sets. # The function drawVennDiagram plots circles (up to three @@ -23,16 +23,19 @@ stop("Only indicator columns permitted") l <- lapply( l, function(x) which(as.logical(x))) - getVennCounts.list(l) + getVennCounts.list(l, universe=universe, verbose=verbose) } # l offers a list of arrays, their values are to # be tested for the size of their intersects. -getVennCounts.list<-function(l, universe=NA, verbose=F) { +getVennCounts.list<-function(l, universe=NA, verbose=F, intersections=TRUE) { if (verbose) cat("Interpreting data as list.\n") numSets<-length(l) result.table<-NULL result.table.names<-NULL + + memberList <- list() + # Iteration over all possible intersections involving all sets # or the complement (negation) of those sets. for (i in 0:(-1 + 2^numSets)) { @@ -104,8 +107,12 @@ sel<-NULL } + r.name<-paste(i2,collapse="") + if (intersections) { + memberList[[r.name]] <- sel + } + r<-length(sel) - r.name<-paste(i2,collapse="") result.row<-c(r,i2) dim(result.row)<-c(1,length(result.row)) rownames(result.row)<-c(r.name) @@ -132,6 +139,9 @@ else{ colnames(result.table)<-c("num",names(l)) } + if (intersections) { + attr(result.table,"intersections") <- memberList + } class(result.table) <- "venn" return(result.table) } @@ -144,9 +154,10 @@ small=0.7, showSetLogicLabel=FALSE, simplify=FALSE, - show.plot=TRUE) + show.plot=TRUE, + intersections=TRUE) { - counts <- getVennCounts(data, universe=universe) + counts <- getVennCounts(data, universe=universe, intersections=intersections) if(show.plot) drawVennDiagram(data=counts, Modified: trunk/gplots/man/venn.Rd =================================================================== --- trunk/gplots/man/venn.Rd 2015-04-23 19:09:17 UTC (rev 1941) +++ trunk/gplots/man/venn.Rd 2015-04-23 19:58:44 UTC (rev 1942) @@ -7,14 +7,14 @@ } \usage{ venn(data, universe=NA, small=0.7, showSetLogicLabel=FALSE, - simplify=FALSE, show.plot=TRUE) + simplify=FALSE, show.plot=TRUE, intersections=TRUE) \method{plot}{venn}(x, y, ..., small=0.7, showSetLogicLabel=FALSE, simplify=FALSE) } \arguments{ \item{data,x}{Either a list list containing vectors of names or indices - of group members, or a data frame containing boolean indicators of - group membership (see below)} + of group intersections, or a data frame containing boolean indicators of + group intersectionship (see below)} \item{universe}{Subset of valid name/index elements. Values ignore values in code{data} not in this list will be ignored. Use \code{NA} to use all elements of \code{data} (the default).} @@ -25,13 +25,17 @@ should be omitted.} \item{show.plot}{Logical flag indicating whether the plot should be displayed. If false, simply returns the group count matrix.} + \item{intersections}{Logical flag indicating + if the returned object should have the attribute + "individuals.in.intersections" featuring for every set a list of + individuals that are assigned to it.} \item{y,...}{Ignored} } \details{ \code{data} should be either a named list of vectors containing character string names ("GeneAABBB", "GeneBBBCY", .., "GeneXXZZ") or - indexes of group members (1, 2, .., N), or a data frame containing - indicator variables (TRUE, FALSE, TRUE, ..) for group membership. + indexes of group intersections (1, 2, .., N), or a data frame containing + indicator variables (TRUE, FALSE, TRUE, ..) for group intersectionship. Group names will be taken from the component list element or column names. } @@ -39,7 +43,7 @@ Invisibly returns an object of class "venn", containing a matrix of all possible sets of groups, and the observed count of items belonging to each The fist column contains observed counts, subsequent columns - contain 0-1 indicators of group membership. + contain 0-1 indicators of group intersectionship. } \author{ Steffen Moeller \email{steffen\_mo...@gm...}, @@ -64,9 +68,9 @@ input <-list(GroupA,GroupB,GroupC,GroupD) input -venn(input) +tmp <- venn(input) +attr(tmp, "intersections") - ## ## Example using a list of item indexes belonging to the ## specified group. @@ -131,6 +135,14 @@ test <- function(x) (x \%in\% GroupA) & (x \%in\% GroupB) & !(x \%in\% GroupC) universe[ test(universe) ] +## +## Intriduced with gplots 2.16, the names of individuals for everz intersection +## is offered as an attribute to the retrun value. +## +a<-venn(list(1:5,3:8),show.plot=F,intersections=TRUE) +intersections<-attr(a,"intersections") +print(intersections) + } \keyword{hplot} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2015-04-23 19:09:24
|
Revision: 1941 http://sourceforge.net/p/r-gregmisc/code/1941 Author: warnes Date: 2015-04-23 19:09:17 +0000 (Thu, 23 Apr 2015) Log Message: ----------- Patch submitted by Ilia Kats: - easily extract and plot subclusters from a big heatmap using the same colorkey, by passing a dendgrogram of the subcluster together with the full data matrix and, optionally, the breaks of the full heatmap in order to obtain the same color scaling. This is useful if one wants to plot several subclusters as different panels in a paper, but maintain consistent color coding. - Improves the behavior of the color key axis labels, as they now honor par("cex") and par("cex.lab"). Modified Paths: -------------- trunk/gplots/R/heatmap.2.R Modified: trunk/gplots/R/heatmap.2.R =================================================================== --- trunk/gplots/R/heatmap.2.R 2015-04-23 18:49:23 UTC (rev 1940) +++ trunk/gplots/R/heatmap.2.R 2015-04-23 19:09:17 UTC (rev 1941) @@ -194,6 +194,8 @@ rowInd <- order.dendrogram(ddr) if(length(rowInd)>nr || any(rowInd<1 | rowInd > nr )) stop("Rowv dendrogram doesn't match size of x") + if (length(rowInd) < nr) + nr <- length(rowInd) } else if (is.integer(Rowv)) { ## Compute dendrogram and do reordering based on given vector @@ -230,6 +232,8 @@ colInd <- order.dendrogram(ddc) if(length(colInd)>nc || any(colInd<1 | colInd > nc )) stop("Colv dendrogram doesn't match size of x") + if (length(colInd) < nc) + nc <- length(colInd) } else if(identical(Colv, "Rowv")) { if(nr != nc) @@ -633,8 +637,8 @@ } else { - min.raw <- min(x, na.rm=TRUE) ## Again, modified to use scaled - max.raw <- max(x, na.rm=TRUE) ## or unscaled (SD 12/2/03) + min.raw <- min.breaks + max.raw <- max.breaks } z <- seq(min.raw, max.raw, length=length(col)) @@ -661,7 +665,7 @@ key.xlab <- "Value" } if (!is.na(key.xlab)) { - mtext(side=1, key.xlab, line=par("mgp")[1], padj=0.5) + mtext(side=1, key.xlab, line=par("mgp")[1], padj=0.5, cex=par("cex") * par("cex.lab")) } if(density.info=="density") @@ -687,7 +691,7 @@ if (is.null(key.ylab)) key.ylab <- "Density" if (!is.na(key.ylab)) - mtext(side=2,key.ylab, line=par("mgp")[1], padj=0.5) + mtext(side=2,key.ylab, line=par("mgp")[1], padj=0.5, cex=par("cex") * par("cex.lab")) } else if(density.info=="histogram") { @@ -710,7 +714,7 @@ if (is.null(key.ylab)) key.ylab <- "Count" if (!is.na(key.ylab)) - mtext(side=2,key.ylab, line=par("mgp")[1], padj=0.5) + mtext(side=2,key.ylab, line=par("mgp")[1], padj=0.5, cex=par("cex") * par("cex.lab")) } else if (is.null(key.title)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2015-04-23 18:49:30
|
Revision: 1940 http://sourceforge.net/p/r-gregmisc/code/1940 Author: warnes Date: 2015-04-23 18:49:23 +0000 (Thu, 23 Apr 2015) Log Message: ----------- In heatmap.2() split calls to distfun() and hclustfun() into separate steps to make debugging easier Modified Paths: -------------- trunk/gplots/R/heatmap.2.R Modified: trunk/gplots/R/heatmap.2.R =================================================================== --- trunk/gplots/R/heatmap.2.R 2015-04-23 17:40:13 UTC (rev 1939) +++ trunk/gplots/R/heatmap.2.R 2015-04-23 18:49:23 UTC (rev 1940) @@ -198,7 +198,8 @@ else if (is.integer(Rowv)) { ## Compute dendrogram and do reordering based on given vector browser() - hcr <- hclustfun(distfun(x)) + distr <- distfun(x) + hcr <- hclustfun(distr) ddr <- as.dendrogram(hcr) ddr <- reorderfun(ddr, Rowv) @@ -209,7 +210,8 @@ else if (isTRUE(Rowv)) { ## If TRUE, compute dendrogram and do reordering based on rowMeans Rowv <- rowMeans(x, na.rm = na.rm) - hcr <- hclustfun(distfun(x)) + distr <- distfun(x) + hcr <- hclustfun(distr) ddr <- as.dendrogram(hcr) ddr <- reorderfun(ddr, Rowv) @@ -240,7 +242,8 @@ colInd <- rowInd } else if(is.integer(Colv)) {## Compute dendrogram and do reordering based on given vector - hcc <- hclustfun(distfun(if(symm)x else t(x))) + distc <- distfun(if(symm)x else t(x)) + hcc <- hclustfun(distc) ddc <- as.dendrogram(hcc) ddc <- reorderfun(ddc, Colv) @@ -251,7 +254,8 @@ else if (isTRUE(Colv)) {## If TRUE, compute dendrogram and do reordering based on rowMeans Colv <- colMeans(x, na.rm = na.rm) - hcc <- hclustfun(distfun(if(symm)x else t(x))) + distc <- distfun(if(symm)x else t(x)) + hcc <- hclustfun(distc) ddc <- as.dendrogram(hcc) ddc <- reorderfun(ddc, Colv) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2015-04-23 17:40:15
|
Revision: 1939 http://sourceforge.net/p/r-gregmisc/code/1939 Author: warnes Date: 2015-04-23 17:40:13 +0000 (Thu, 23 Apr 2015) Log Message: ----------- Update NEWS and ChangeLog Modified Paths: -------------- trunk/gdata/inst/ChangeLog trunk/gdata/inst/NEWS Modified: trunk/gdata/inst/ChangeLog =================================================================== --- trunk/gdata/inst/ChangeLog 2015-04-23 17:37:37 UTC (rev 1938) +++ trunk/gdata/inst/ChangeLog 2015-04-23 17:40:13 UTC (rev 1939) @@ -1,5 +1,12 @@ +2015-04-23 warnes + + * [r1938] R/reorder.R: reorder.factor() now hands off processing to + stats:::reorder.default() when either 'X' or 'FUN' is specified. + 2015-04-22 warnes + * [r1937] inst/ChangeLog, inst/NEWS: Update NEWS and ChangeLog for + changes to humanReadable() * [r1936] DESCRIPTION, R/humanReadable.R, R/object.size.R, man/humanReadable.Rd: Fix 'units' argument of humanReadable() * [r1935] man/object.size.Rd: Update object.size() man page to Modified: trunk/gdata/inst/NEWS =================================================================== --- trunk/gdata/inst/NEWS 2015-04-23 17:37:37 UTC (rev 1938) +++ trunk/gdata/inst/NEWS 2015-04-23 17:40:13 UTC (rev 1939) @@ -26,8 +26,9 @@ - reorder.factor() was ignoring the argument 'X', making it incompatible with the behavior of stats:::reorder.default(). This has been corrected, - and providing 'X' now returns the same results whether gdata is loaded - or not. (Reported by Sam Hunter.) + and providing either 'X' or 'FUN' causes processing to be handed off to + stats:::reorder.defailt() so will return the same results whether gdata + is loaded or not. (Reported by Sam Hunter.) Other changes: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2015-04-23 17:37:40
|
Revision: 1938 http://sourceforge.net/p/r-gregmisc/code/1938 Author: warnes Date: 2015-04-23 17:37:37 +0000 (Thu, 23 Apr 2015) Log Message: ----------- reorder.factor() now hands off processing to stats:::reorder.default() when either 'X' or 'FUN' is specified. Modified Paths: -------------- trunk/gdata/R/reorder.R Modified: trunk/gdata/R/reorder.R =================================================================== --- trunk/gdata/R/reorder.R 2015-04-22 23:18:53 UTC (rev 1937) +++ trunk/gdata/R/reorder.R 2015-04-23 17:37:37 UTC (rev 1938) @@ -12,7 +12,7 @@ { constructor <- if (order) ordered else factor - if(!missing(X)) + if(!missing(X) || !missing(FUN)) return( NextMethod(x)) if (!missing(new.order)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2015-04-22 23:18:55
|
Revision: 1937 http://sourceforge.net/p/r-gregmisc/code/1937 Author: warnes Date: 2015-04-22 23:18:53 +0000 (Wed, 22 Apr 2015) Log Message: ----------- Update NEWS and ChangeLog for changes to humanReadable() Modified Paths: -------------- trunk/gdata/inst/ChangeLog trunk/gdata/inst/NEWS Modified: trunk/gdata/inst/ChangeLog =================================================================== --- trunk/gdata/inst/ChangeLog 2015-04-22 23:14:54 UTC (rev 1936) +++ trunk/gdata/inst/ChangeLog 2015-04-22 23:18:53 UTC (rev 1937) @@ -1,5 +1,12 @@ 2015-04-22 warnes + * [r1936] DESCRIPTION, R/humanReadable.R, R/object.size.R, + man/humanReadable.Rd: Fix 'units' argument of humanReadable() + * [r1935] man/object.size.Rd: Update object.size() man page to + reflect change in class of return value from 'object_size' to + 'object_sizes' + * [r1934] inst/ChangeLog, inst/NEWS: Update NEWS and ChangeLog for + gdata 2.16.0 * [r1933] NAMESPACE, R/object.size.R: Modify gdaata:object.size to generate S3 objects of class 'object_sizes' (note the final 's') to avoid conflicts with methods in utils for object_size. Modified: trunk/gdata/inst/NEWS =================================================================== --- trunk/gdata/inst/NEWS 2015-04-22 23:14:54 UTC (rev 1936) +++ trunk/gdata/inst/NEWS 2015-04-22 23:18:53 UTC (rev 1937) @@ -13,6 +13,15 @@ prevent numeric columns from being displayed using scientific notification. +- The 'standard' argument to humanReadable() now accepts only two values, + 'SI' for base 1000, and IEC for base 1024. + +- New 'units' argument to humanReadable() that permits specifying the + standard unit to use for all values. + +- The object.size() function now accepts the 'units' argument which is + passed onto humanReadable(). + Bug fixes: - reorder.factor() was ignoring the argument 'X', making it incompatible This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2015-04-22 23:15:01
|
Revision: 1936 http://sourceforge.net/p/r-gregmisc/code/1936 Author: warnes Date: 2015-04-22 23:14:54 +0000 (Wed, 22 Apr 2015) Log Message: ----------- Fix 'units' argument of humanReadable() Modified Paths: -------------- trunk/gdata/DESCRIPTION trunk/gdata/R/object.size.R trunk/gdata/man/humanReadable.Rd Added Paths: ----------- trunk/gdata/R/humanReadable.R Modified: trunk/gdata/DESCRIPTION =================================================================== --- trunk/gdata/DESCRIPTION 2015-04-22 22:44:46 UTC (rev 1935) +++ trunk/gdata/DESCRIPTION 2015-04-22 23:14:54 UTC (rev 1936) @@ -4,8 +4,8 @@ Depends: R (>= 2.13.0) SystemRequirements: perl Imports: gtools -Version: 2.15.0 -Date: 2015-04-06 +Version: 2.16.0 +Date: 2015-04-21 Author: Gregory R. Warnes, Ben Bolker, Gregor Gorjanc, Gabor Grothendieck, Ales Korosec, Thomas Lumley, Don MacQueen, Arni Magnusson, Jim Rogers, and others Added: trunk/gdata/R/humanReadable.R =================================================================== --- trunk/gdata/R/humanReadable.R (rev 0) +++ trunk/gdata/R/humanReadable.R 2015-04-22 23:14:54 UTC (rev 1936) @@ -0,0 +1,61 @@ +humanReadable <- function(x, standard=c("SI", "IEC"), units, digits=1, width=3, sep=" ") +{ + ## --- Setup --- + + suffix.decimal <- c("B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB") + suffix.binary <- c("B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB") + + standard <- match.arg(standard) + + ## --- Functions --- + + .applyHuman <- function(x, base, suffix, digits, width, sep) + { + ## Which suffix should we use? + n <- length(suffix) + for(i in 1:n) { + if(x >= base) { + if(i < n) x <- x / base + } else { + break + } + } + ## Formatting + if(is.null(width)) { ## the same formatting for all + x <- format(round(x=x, digits=digits), nsmall=digits) + } else { ## similar to ls, du, and df + lenX <- nchar(x) + if(lenX > width) { + digitsMy <- width - (lenX - (lenX - (nchar(round(x)) + 1))) + digits <- ifelse(digitsMy > digits, digits, digitsMy) + } + if(i == 1) digits <- 0 + x <- round(x, digits=digits) + } + paste(x, suffix[i], sep=sep) + } + + ## -- Work + + if(any(x < 0)) stop("'x' must be positive") + if(standard == "SI") { + suffix <- suffix.decimal + base <- 10^3 + } else { + suffix <- suffix.binary + base <- 2^10 + } + + if(!missing(units)) + { + units <- match.arg( units, suffix ) + power <- match(units, suffix ) -1 + X <- x/(base^power) + X <- format.default(round(x=X, digits=digits), nsmall=digits) + X <- paste(X, units) + X + } + else + sapply(X=x, FUN=".applyHuman", base=base, suffix=suffix, digits=digits, + width=width, sep=sep) +} Modified: trunk/gdata/R/object.size.R =================================================================== --- trunk/gdata/R/object.size.R 2015-04-22 22:44:46 UTC (rev 1935) +++ trunk/gdata/R/object.size.R 2015-04-22 23:14:54 UTC (rev 1936) @@ -104,5 +104,6 @@ width=width, sep=sep) } + ###------------------------------------------------------------------------ ### object.size.R ends here Modified: trunk/gdata/man/humanReadable.Rd =================================================================== --- trunk/gdata/man/humanReadable.Rd 2015-04-22 22:44:46 UTC (rev 1935) +++ trunk/gdata/man/humanReadable.Rd 2015-04-22 23:14:54 UTC (rev 1936) @@ -19,15 +19,14 @@ } \usage{ - -humanReadable(x, standard="SI", digits=1, width=3, sep=" ") - +humanReadable(x, standard=c("SI","IEC"), units, digits=1, width=3, sep=" ") } \arguments{ \item{x}{integer, byte size} - \item{standard}{character, "SI" for powers of 1000 or anything else for + \item{standard}{character, either "SI" for powers of 1000 or "IEC" for powers of 1024, see details} + \item{units}{character, unit to use for all values (optional)} \item{digits}{integer, number of digits after decimal point} \item{width}{integer, width of number string} \item{sep}{character, separator between number and unit} @@ -104,6 +103,14 @@ \examples{ +# Simple example: maximum addressible size of 32 bit pointer +humanReadable(2^32-1, standard="SI") +humanReadable(2^32-1, standard="IEC") + +humanReadable(2^32-1, standard="SI", unit="MB") +humanReadable(2^32-1, standard="IEC", unit="MiB") + + baseSI <- 10 powerSI <- seq(from=3, to=27, by=3) SI0 <- (baseSI)^powerSI @@ -117,12 +124,22 @@ IEC1 <- IEC0 - IEC0 / c(2, runif(n=k, min=1.01, max=5.99)) IEC2 <- IEC0 + IEC0 / c(2, runif(n=k, min=1.01, max=5.99)) +# Auto units cbind(humanReadable(x=SI1, width=NULL, digits=3), humanReadable(x=SI0, width=NULL, digits=2), humanReadable(x=SI2, width=NULL, digits=1), humanReadable(x=IEC1, standard="IEC", width=7, digits=3), humanReadable(x=IEC0, standard="IEC", width=7, digits=2), humanReadable(x=IEC2, standard="IEC", width=7, digits=1)) + +# Single unit +cbind(humanReadable(x=SI1, units="GB", width=NULL, digits=3), + humanReadable(x=SI0, units="GB", width=NULL, digits=2), + humanReadable(x=SI2, units="GB", width=NULL, digits=1), + humanReadable(x=IEC1, units="GiB", standard="IEC", width=7, digits=3), + humanReadable(x=IEC0, units="GiB", standard="IEC", width=7, digits=2), + humanReadable(x=IEC2, units="GiB", standard="IEC", width=7, digits=1)) + } \keyword{misc} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2015-04-22 22:44:48
|
Revision: 1935 http://sourceforge.net/p/r-gregmisc/code/1935 Author: warnes Date: 2015-04-22 22:44:46 +0000 (Wed, 22 Apr 2015) Log Message: ----------- Update object.size() man page to reflect change in class of return value from 'object_size' to 'object_sizes' Modified Paths: -------------- trunk/gdata/man/object.size.Rd Modified: trunk/gdata/man/object.size.Rd =================================================================== --- trunk/gdata/man/object.size.Rd 2015-04-22 22:41:58 UTC (rev 1934) +++ trunk/gdata/man/object.size.Rd 2015-04-22 22:44:46 UTC (rev 1935) @@ -5,10 +5,10 @@ \name{object.size} \alias{object.size} -\alias{print.object_size} -\alias{c.object_size} -\alias{as.object_size} -\alias{is.object_size} +\alias{print.object_sizes} +\alias{c.object_sizes} +\alias{as.object_sizes} +\alias{is.object_sizes} \title{Report the Space Allocated for an Object} \description{ @@ -17,7 +17,7 @@ \usage{ object.size(\dots) -\method{print}{object_size}(x, quote=FALSE, humanReadable, \dots) +\method{print}{object_sizes}(x, quote=FALSE, humanReadable, \dots) } \arguments{ \item{\dots}{\code{object.size}: \R objects; \code{print}; arguments @@ -76,10 +76,10 @@ object.size(get(x, envir = baseenv()))) (tmp <- as.matrix(rev(sort(z))[1:10])) -as.object_size(14567567) +as.object_sizes(14567567) options(humanReadable=TRUE) (z <- object.size(letters, c(letters, letters), rep(letters, 100), rep(letters, 10000))) -is.object_size(z) -as.object_size(14567567) +is.object_sizes(z) +as.object_sizes(14567567) } \keyword{utilities} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2015-04-22 22:42:01
|
Revision: 1934 http://sourceforge.net/p/r-gregmisc/code/1934 Author: warnes Date: 2015-04-22 22:41:58 +0000 (Wed, 22 Apr 2015) Log Message: ----------- Update NEWS and ChangeLog for gdata 2.16.0 Modified Paths: -------------- trunk/gdata/inst/ChangeLog trunk/gdata/inst/NEWS Modified: trunk/gdata/inst/ChangeLog =================================================================== --- trunk/gdata/inst/ChangeLog 2015-04-22 22:34:53 UTC (rev 1933) +++ trunk/gdata/inst/ChangeLog 2015-04-22 22:41:58 UTC (rev 1934) @@ -1,5 +1,16 @@ +2015-04-22 warnes + + * [r1933] NAMESPACE, R/object.size.R: Modify gdaata:object.size to + generate S3 objects of class 'object_sizes' (note the final 's') + to avoid conflicts with methods in utils for object_size. + * [r1932] R/reorder.R, tests/test.reorder.factor.R, + tests/test.reorder.factor.Rout.save: Correct behavior of + reorder.factor() when argument 'X' is supplied by delgating to + stats:::reorder.default() + 2015-04-14 warnes + * [r1929] inst/ChangeLog: Update ChangeLog * [r1928] man/write.fwf.Rd: Remove editorializing * [r1927] inst/ChangeLog, inst/NEWS: Update NEWS and ChangeLog for gdata 2.15.0 Modified: trunk/gdata/inst/NEWS =================================================================== --- trunk/gdata/inst/NEWS 2015-04-22 22:34:53 UTC (rev 1933) +++ trunk/gdata/inst/NEWS 2015-04-22 22:41:58 UTC (rev 1934) @@ -1,4 +1,4 @@ -Changes in 2.15.0 (2015-04-06) +Changes in 2.16.0 (2015-04-21) ------------------------------ New features: @@ -13,12 +13,23 @@ prevent numeric columns from being displayed using scientific notification. +Bug fixes: + +- reorder.factor() was ignoring the argument 'X', making it incompatible + with the behavior of stats:::reorder.default(). This has been corrected, + and providing 'X' now returns the same results whether gdata is loaded + or not. (Reported by Sam Hunter.) + Other changes: -- Replaced depricated PERL function POSIX::isdigit with equivalent - regular expression. +- Replaced depricated PERL function POSIX::isdigit with equivalent regular + expression. +- object.size() now returns objects with S3 class 'object_sizes' (note the + final 's') to avoid conflicts with methods in utils for class 'object_size' + which can only handle a scalar size. + Changes in 2.14.0 (2014-08-27) ------------------------------ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2015-04-22 22:35:00
|
Revision: 1933 http://sourceforge.net/p/r-gregmisc/code/1933 Author: warnes Date: 2015-04-22 22:34:53 +0000 (Wed, 22 Apr 2015) Log Message: ----------- Modify gdaata:object.size to generate S3 objects of class 'object_sizes' (note the final 's') to avoid conflicts with methods in utils for object_size. Modified Paths: -------------- trunk/gdata/NAMESPACE trunk/gdata/R/object.size.R Modified: trunk/gdata/NAMESPACE =================================================================== --- trunk/gdata/NAMESPACE 2015-04-22 22:32:01 UTC (rev 1932) +++ trunk/gdata/NAMESPACE 2015-04-22 22:34:53 UTC (rev 1933) @@ -52,7 +52,7 @@ xlsFormats, ## Object size stuff - object.size, as.object_size, is.object_size, humanReadable, + object.size, as.object_sizes, is.object_sizes, humanReadable, ## getDateTime stuff getYear, getMonth, getDay, getHour, getMin, getSec, @@ -129,8 +129,8 @@ S3method(nobs, lm) # now provided by stats package ## Object size stuff -S3method(print, object_size) -S3method(c, object_size) +S3method(print, object_sizes) +S3method(c, object_sizes) ## unknown stuff S3method(isUnknown, default) Modified: trunk/gdata/R/object.size.R =================================================================== --- trunk/gdata/R/object.size.R 2015-04-22 22:32:01 UTC (rev 1932) +++ trunk/gdata/R/object.size.R 2015-04-22 22:34:53 UTC (rev 1933) @@ -4,15 +4,15 @@ ### $Id$ ### Time-stamp: <2008-12-30 08:05:43 ggorjan> ###------------------------------------------------------------------------ - object.size <- function(...) { structure(sapply(list(...), utils::object.size), - class=c("object_size", "numeric")) + class=c("object_sizes", "numeric")) } -print.object_size <- function(x, quote=FALSE, humanReadable, ...) +print.object_sizes <- function(x, quote=FALSE, units, + humanReadable, ...) { xOrig <- x if(missing(humanReadable)) { @@ -28,37 +28,31 @@ invisible(xOrig) } -is.object_size <- function(x) inherits(x, what="object_size") +is.object_sizes <- function(x) inherits(x, what="object_sizes") -as.object_size <- function(x) +as.object_sizes <- function(x) { if(!is.numeric(x)) stop("'x' must be numeric/integer") - class(x) <- c("object_size", "numeric") + class(x) <- c("object_sizes", "numeric") x } -c.object_size <- function(..., recursive=FALSE) +c.object_sizes <- function(..., recursive=FALSE) { x <- NextMethod() - if(is.numeric(x)) class(x) <- c("object_size", "numeric") + if(is.numeric(x)) class(x) <- c("object_sizes", "numeric") x } -humanReadable <- function(x, standard="SI", digits=1, width=3, sep=" ") +humanReadable <- function(x, standard="SI", units, digits=1, width=3, sep=" ") { ## --- Setup --- - if(any(x < 0)) stop("'x' must be positive") - if(standard == "SI") { - suffix <- c("B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB") - base <- 1000 - } else { - suffix <- c("B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB") - base <- 1024 - } + suffix.decimal <- c("B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB") + suffix.binary <- c("B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB") + + ## --- Functions --- - ## --- Apply --- - .applyHuman <- function(x, base, suffix, digits, width, sep) { ## Which suffix should we use? @@ -85,8 +79,29 @@ paste(x, suffix[i], sep=sep) } - sapply(X=x, FUN=".applyHuman", base=base, suffix=suffix, digits=digits, - width=width, sep=sep) + ## -- Work + + if(any(x < 0)) stop("'x' must be positive") + if(standard == "SI") { + suffix <- suffix.decimal + base <- 10^3 + } else { + suffix <- suffix.binary + base <- 2^10 + } + + if(!missing(units)) + { + units <- match.arg( units, suffix ) + power <- which( units %in% suffix ) -1 + X <- x/(base^power) + X <- format.default(round(x=x, digits=digits), nsmall=digits) + X <- paste(X, units) + X + } + else + sapply(X=x, FUN=".applyHuman", base=base, suffix=suffix, digits=digits, + width=width, sep=sep) } ###------------------------------------------------------------------------ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2015-04-22 22:32:08
|
Revision: 1932 http://sourceforge.net/p/r-gregmisc/code/1932 Author: warnes Date: 2015-04-22 22:32:01 +0000 (Wed, 22 Apr 2015) Log Message: ----------- Correct behavior of reorder.factor() when argument 'X' is supplied by delgating to stats:::reorder.default() Modified Paths: -------------- trunk/gdata/R/reorder.R Added Paths: ----------- trunk/gdata/tests/test.reorder.factor.R trunk/gdata/tests/test.reorder.factor.Rout.save Modified: trunk/gdata/R/reorder.R =================================================================== --- trunk/gdata/R/reorder.R 2015-04-22 21:35:19 UTC (rev 1931) +++ trunk/gdata/R/reorder.R 2015-04-22 22:32:01 UTC (rev 1932) @@ -12,6 +12,9 @@ { constructor <- if (order) ordered else factor + if(!missing(X)) + return( NextMethod(x)) + if (!missing(new.order)) { if (is.numeric(new.order)) Added: trunk/gdata/tests/test.reorder.factor.R =================================================================== --- trunk/gdata/tests/test.reorder.factor.R (rev 0) +++ trunk/gdata/tests/test.reorder.factor.R 2015-04-22 22:32:01 UTC (rev 1932) @@ -0,0 +1,11 @@ +## Test results before and after loading gdata + +m <- factor(c('a','b','c')) + +( m1 <- reorder(m, X=c(3, 2, 1)) ) + +library(gdata) + +( m2 <- reorder(m, X=c(3, 2, 1)) ) + +stopifnot(identical(m1,m2)) Added: trunk/gdata/tests/test.reorder.factor.Rout.save =================================================================== --- trunk/gdata/tests/test.reorder.factor.Rout.save (rev 0) +++ trunk/gdata/tests/test.reorder.factor.Rout.save 2015-04-22 22:32:01 UTC (rev 1932) @@ -0,0 +1,60 @@ + +R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet" +Copyright (C) 2014 The R Foundation for Statistical Computing +Platform: x86_64-unknown-linux-gnu (64-bit) + +R is free software and comes with ABSOLUTELY NO WARRANTY. +You are welcome to redistribute it under certain conditions. +Type 'license()' or 'licence()' for distribution details. + + Natural language support but running in an English locale + +R is a collaborative project with many contributors. +Type 'contributors()' for more information and +'citation()' on how to cite R or R packages in publications. + +Type 'demo()' for some demos, 'help()' for on-line help, or +'help.start()' for an HTML browser interface to help. +Type 'q()' to quit R. + +> ## Test results before and after loading gdata +> +> m <- factor(c('a','b','c')) +> +> ( m1 <- reorder(m, X=c(3, 2, 1)) ) +[1] a b c +attr(,"scores") +a b c +3 2 1 +Levels: c b a +> +> library(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 + +Warning message: +S3 methods ‘print.object_size’, ‘c.object_size’ were declared in NAMESPACE but not found +> +> ( m2 <- reorder(m, X=c(3, 2, 1)) ) +[1] a b c +attr(,"scores") +a b c +3 2 1 +Levels: c b a +> +> stopifnot(identical(m1,m2)) +> +> proc.time() + user system elapsed + 0.512 0.070 0.638 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2015-04-22 21:35:26
|
Revision: 1931 http://sourceforge.net/p/r-gregmisc/code/1931 Author: warnes Date: 2015-04-22 21:35:19 +0000 (Wed, 22 Apr 2015) Log Message: ----------- Update DESCRIPTION, ChangeLog, and NEWS for gplots 2.17.0 Modified Paths: -------------- trunk/gplots/DESCRIPTION trunk/gplots/inst/ChangeLog trunk/gplots/inst/NEWS Modified: trunk/gplots/DESCRIPTION =================================================================== --- trunk/gplots/DESCRIPTION 2015-04-22 21:33:06 UTC (rev 1930) +++ trunk/gplots/DESCRIPTION 2015-04-22 21:35:19 UTC (rev 1931) @@ -4,8 +4,8 @@ Depends: R (>= 3.0) Imports: gtools, gdata, stats, caTools, KernSmooth Suggests: grid, MASS -Version: 2.16.0 -Date: 2015-01-02 +Version: 2.17.0 +Date: 2015-04-21 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/ChangeLog =================================================================== --- trunk/gplots/inst/ChangeLog 2015-04-22 21:33:06 UTC (rev 1930) +++ trunk/gplots/inst/ChangeLog 2015-04-22 21:35:19 UTC (rev 1931) @@ -1,3 +1,33 @@ +2015-04-22 warnes + + * [r1930] R/heatmap.2.R, man/heatmap.2.Rd: heatmap.2: add new + 'colRow' and 'colCol' arguments to control the color of row and + column text labels + +2015-04-06 warnes + + * [r1916] inst/ChangeLog: Add ChangeLog files to repository + +2015-01-02 warnes + + * [r1913] DESCRIPTION, inst/NEWS: Update for gplots release 2.16.0. + * [r1912] R/plotmeans.R: Change default group count lable back to + 'n='. + * [r1911] R/plotmeans.R, man/plotmeans.Rd: - plotmeans: Pass + optional graphical arguments captured in '...' axis function + used to draw the x axis. + - plotmeans: Add an new argument 'text.n.label' to specify the + text + used for labelingthe number of elements in a group. + * [r1910] R/plotmeans.R: - Remove S-Plus-specific code + - Simplify model frame code + +2014-12-03 warnes + + * [r1909] tests/heatmap2Test.Rout.save: Update stored test output + to account for new startup message from KernSmooth package + * [r1908] DESCRIPTION: Fix package title capitalization. + 2014-12-02 warnes * [r1907] inst/NEWS: Add descrioption of node stack overflow issue Modified: trunk/gplots/inst/NEWS =================================================================== --- trunk/gplots/inst/NEWS 2015-04-22 21:33:06 UTC (rev 1930) +++ trunk/gplots/inst/NEWS 2015-04-22 21:35:19 UTC (rev 1931) @@ -1,3 +1,12 @@ +Release 2.17.0 - 2015-04-21 +--------------------------- + +New Features: + +- heatmap.2() has two new arguments, 'colRow' and 'colCol' to control + the color of row and column text labels. + + Release 2.16.0 - 2015-01-02 --------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2015-04-22 21:33:14
|
Revision: 1930 http://sourceforge.net/p/r-gregmisc/code/1930 Author: warnes Date: 2015-04-22 21:33:06 +0000 (Wed, 22 Apr 2015) Log Message: ----------- heatmap.2: add new 'colRow' and 'colCol' arguments to control the color of row and column text labels Modified Paths: -------------- trunk/gplots/R/heatmap.2.R trunk/gplots/man/heatmap.2.Rd Modified: trunk/gplots/R/heatmap.2.R =================================================================== --- trunk/gplots/R/heatmap.2.R 2015-04-14 22:02:42 UTC (rev 1929) +++ trunk/gplots/R/heatmap.2.R 2015-04-22 21:33:06 UTC (rev 1930) @@ -59,6 +59,8 @@ adjCol = c(NA,0), offsetRow = 0.5, offsetCol = 0.5, + colRow = NULL, + colCol = NULL, ## color key + density info key = TRUE, @@ -281,6 +283,12 @@ labCol <- if(is.null(colnames(x))) (1:nc)[colInd] else colnames(x) else labCol <- labCol[colInd] + + if(!is.null(colRow)) + colRow <- colRow[rowInd] + + if(!is.null(colCol)) + colCol <- colCol[colInd] if(scale == "row") { retval$rowMeans <- rm <- rowMeans(x, na.rm = na.rm) @@ -415,7 +423,7 @@ } ## add column labels - if(is.null(srtCol)) + if(is.null(srtCol) && is.null(colCol)) axis(1, 1:nc, labels= labCol, @@ -428,7 +436,7 @@ ) else { - if(is.numeric(srtCol)) + if(is.null(srtCol) || is.numeric(srtCol)) { if(missing(adjCol) || is.null(adjCol)) adjCol=c(1,NA) @@ -442,7 +450,10 @@ ##pos=1, adj=adjCol, cex=cexCol, - srt=srtCol) + srt=srtCol, + col=colCol + ) + print(colCol) par(xpd=xpd.orig) } else @@ -450,7 +461,7 @@ } ## add row labels - if(is.null(srtRow)) + if(is.null(srtRow) && is.null(colRow)) { axis(4, iy, @@ -465,7 +476,7 @@ } else { - if(is.numeric(srtRow)) + if(is.null(srtRow) || is.numeric(srtRow)) { xpd.orig <- par("xpd") par(xpd=NA) @@ -475,7 +486,8 @@ labels=labRow, adj=adjRow, cex=cexRow, - srt=srtRow + srt=srtRow, + col=colRow ) par(xpd=xpd.orig) } Modified: trunk/gplots/man/heatmap.2.Rd =================================================================== --- trunk/gplots/man/heatmap.2.Rd 2015-04-14 22:02:42 UTC (rev 1929) +++ trunk/gplots/man/heatmap.2.Rd 2015-04-22 21:33:06 UTC (rev 1930) @@ -71,6 +71,8 @@ adjCol = c(NA,0), offsetRow = 0.5, offsetCol = 0.5, + colRow = NULL, + colCol = NULL, # color key + density info key = TRUE, @@ -111,10 +113,11 @@ \code{\link{dendrogram}}, then it is used "as-is", ie without any reordering. If a vector of integers, then dendrogram is computed and reordered based on the order of the vector.} - \item{Colv}{determines if and how the \emph{column} dendrogram should be - reordered. Has the options as the \code{Rowv} argument above and - \emph{additionally} when \code{x} is a square matrix, \code{Colv = - "Rowv"} means that columns should be treated identically to the rows.} + \item{Colv}{determines if and how the \emph{column} dendrogram should + be reordered. Has the options as the \code{Rowv} argument above and + \emph{additionally} when \code{x} is a square matrix, + \code{Colv="Rowv"} means that columns should be treated identically + to the rows.} \item{distfun}{function used to compute the distance (dissimilarity) between both rows and columns. Defaults to \code{\link{dist}}.} \item{hclustfun}{function used to compute the hierarchical clustering @@ -128,7 +131,8 @@ reordering the row and column dendrograms. The default uses \code{\link{stats}{reorder.dendrogram}} }. \item{symm}{logical indicating if \code{x} should be treated - \bold{symm}etrically; can only be true when \code{x} is a square matrix.} + \bold{symm}etrically; can only be true when \code{x} is a + square matrix.} % data scaling \item{scale}{character indicating if the values should be centered and scaled in either the row direction or the column direction, or @@ -150,12 +154,14 @@ \item{col}{colors used for the image. Defaults to heat colors (\code{heat.colors}).} % block separation - \item{colsep, rowsep, sepcolor}{(optional) vector of integers indicating - which columns or rows should be separated from the preceding columns - or rows by a narrow space of color \code{sepcolor}.} - \item{sepwidth}{(optional) Vector of length 2 giving the width (colsep) or height (rowsep) the separator box - drawn by colsep and rowsep as a function of the width (colsep) or - height (rowsep) of a cell. Defaults to \code{c(0.05, 0.05)}} + \item{colsep, rowsep, sepcolor}{(optional) vector of integers + indicating which columns or rows should be separated from the + preceding columns or rows by a narrow space of color + \code{sepcolor}.} + \item{sepwidth}{(optional) Vector of length 2 giving the width + (colsep) or height (rowsep) the separator box drawn by colsep and + rowsep as a function of the width (colsep) or height (rowsep) of a + cell. Defaults to \code{c(0.05, 0.05)}} % cell labeling \item{cellnote}{(optional) matrix of character strings which will be placed within each color cell, e.g. p-value symbols.} @@ -181,25 +187,31 @@ defaults to the value of \code{tracecol}.} % Row/Column Labeling \item{margins}{numeric vector of length 2 containing the margins - (see \code{\link{par}(mar= *)}) for column and row names, respectively.} - \item{ColSideColors}{(optional) character vector of length \code{ncol(x)} - containing the color names for a horizontal side bar that may be used to - annotate the columns of \code{x}.} - \item{RowSideColors}{(optional) character vector of length \code{nrow(x)} - containing the color names for a vertical side bar that may be used to - annotate the rows of \code{x}.} + (see \code{\link{par}(mar= *)}) for column and row names, + respectively.} + \item{ColSideColors}{(optional) character vector of length + \code{ncol(x)} containing the color names for a horizontal side bar + that may be used to annotate the columns of \code{x}.} + \item{RowSideColors}{(optional) character vector of length + \code{nrow(x)} containing the color names for a vertical side bar + that may be used to annotate the rows of \code{x}.} \item{cexRow, cexCol}{positive numbers, used as \code{cex.axis} in for the row or column axis labeling. The defaults currently only use number of rows or columns, respectively.} \item{labRow, labCol}{character vectors with row and column labels to use; these default to \code{rownames(x)} or \code{colnames(x)}, respectively.} - \item{srtRow, srtCol}{angle of row/column labels, in degrees from horizontal} + \item{srtRow, srtCol}{angle of row/column labels, in degrees from + horizontal} \item{adjRow, adjCol}{2-element vector giving the (left-right, top-bottom) justification of row/column labels (relative to the text - orientation).} - \item{offsetRow, offsetCol}{Number of character-width spaces to place - between row/column labels and the edge of the plotting region.} + orientation).} + \item{offsetRow, offsetCol}{Number of character-width spaces to + place between row/column labels and the edge of the plotting + region.} + \item{colRow, colCol}{color of row/column labels, either a scalar to + set the color of all labels the same, or a vector providing the + colors of each label item} % Color key and density info \item{key}{logical indicating whether a color-key should be shown.} \item{keysize}{numeric value indicating the size of the key} @@ -226,8 +238,8 @@ the xaxis of the color key. Returns a named list containing parameters that can be passed to \code{axis}. See examples.} \item{key.ytickfun}{function computing tick location and labels for - the y axis of the color key. Returns a named list containing - parameters that can be passed to \code{axis}. See examples.} + the y axis of the color key. Returns a named list containing + parameters that can be passed to \code{axis}. See examples.} \item{key.par}{graphical parameters for the color key. Named list that can be passed to \code{par}.} % plot labels @@ -446,14 +458,19 @@ RowSideColors=rc, ColSideColors=cc, margin=c(5, 10), xlab="specification variables", ylab= "Car Models", main="heatmap(<Mtcars data>, ..., scale=\"column\")", - tracecol="green", density="density") + tracecol="green", density="density") ## Note that the breakpoints are now symmetric about 0 + + ## Color the labels to match RowSideColors and ColSideColors + hv <- heatmap.2(x, col=cm.colors(255), scale="column", + RowSideColors=rc, ColSideColors=cc, margin=c(5, 10), + xlab="specification variables", ylab= "Car Models", + main="heatmap(<Mtcars data>, ..., scale=\"column\")", + tracecol="green", density="density", colRow=rc, colCol=cc, + srtCol=45, adjCol=c(0.5,1)) + - - - - %% want example using the `add.exp' argument! data(attitude) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |