R/prince.plot.R

Defines functions prince.plot

Documented in prince.plot

prince.plot <-
function(prince,label=colnames(prince$o),smallest=-20,note=F,notecol="black",notecex=1,breaks=seq(-20,0,length.out=100),col=heat.colors(99),margins=c(5,7),key=T,cexRow=1,cexCol=1,xlab="Principal Components (Variation)",colsep=NULL,rowsep=NULL,sepcolor="black",sepwidth=c(0.05,0.05),Rsquared=F,breaksRsquared=seq(0,1,length.out=100)){
   if(class(prince)!="prince"){stop("prince is not an object generated by the function prince")}
   if(smallest>0){stop("smallest has to be less than 0")}
   linp10<-log10(prince$linp)
   linp10<-replace(linp10,linp10<=smallest,smallest)
   tonote<-signif(prince$linp,1)
   prop<-round(prince$prop,0)
   if (Rsquared==T){linp10<-prince$rsquared
                    breaks<-breaksRsquared
                    tonote<-round(prince$rsquared,2)
                    col<-col[length(col):1]
                    }
   heatmap.2(linp10,Colv=F,Rowv=F,dendrogram="none",trace="none",symbreaks=F,symkey=F,breaks=breaks,key=key,col=col,cexRow=cexRow,cexCol=cexCol,colsep=colsep,rowsep=rowsep,sepcolor=sepcolor,sepwidth=sepwidth,
            main="",labCol=paste(1:ncol(linp10)," (",prop,")",sep=""),margins=margins,labRow=label,xlab=xlab,
            cellnote=if(note==T){tonote}else{matrix(ncol=ncol(prince$linp),nrow=nrow(prince$linp))},notecol=notecol,notecex=notecex) 
    }

Try the swamp package in your browser

Any scripts or data that you put into this service are public.

swamp documentation built on Dec. 6, 2019, 5:09 p.m.