Skip to content

Commit

Permalink
-multiHeatMatrix does work when group is a factor
Browse files Browse the repository at this point in the history
- xlabels overlap with the tickmarks less
- new argument, common.scale multiHeatMatrix
  • Loading branch information
al2na committed Nov 18, 2013
1 parent 885b3e5 commit b94864c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions R/plotMatrix.R
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ heatMatrix<-function(mat,grid=FALSE,col=NULL,xcoords=NULL,
else if(is.factor(group)){

# check if the length is same as nrow(mat)
if(length(group)==nrow(mat)){
if( length(group) != nrow(mat)){
stop("'group' is a factor, and its length should be equal to nrow(mat)\n")
}
# arrange factor levels by the order of appeareance
Expand Down Expand Up @@ -651,10 +651,10 @@ heatMatrix<-function(mat,grid=FALSE,col=NULL,xcoords=NULL,
}

}else if(order & !kmeans ){ # if only ordering is needed no group or clustering
order.vector=rep(1,nrow(mat2))
order.vector =rep(1,nrow(mat2))
names(order.vector)=rownames(mat2)
order.vector= order.vector[order(-rowSums(mat2,na.rm=TRUE))]
mat2=mat2[order(-rowSums(mat2,na.rm=TRUE)),]
order.vector = order.vector[order(-rowSums(mat2,na.rm=TRUE))]
mat2 =mat2[order(-rowSums(mat2,na.rm=TRUE)),]

}

Expand Down

0 comments on commit b94864c

Please sign in to comment.