R/pcaSupplementaryRowsPreProcessing.R

Defines functions pcaSupplementaryRowsPreProcessing

Documented in pcaSupplementaryRowsPreProcessing

pcaSupplementaryRowsPreProcessing <- function(SUP.DATA=NULL,center=TRUE,scale=TRUE,W=NULL){
	if(is.null(SUP.DATA)){
		stop('Must provide supplemental data')
	}
	if(is.null(W)){
		W <- rep(1,ncol(SUP.DATA)) #you need to choose or else I make nothing happen...
	}else if(length(W)!=ncol(SUP.DATA)){
		stop('Length of W does not match column dim of SUP.DATA')
	}
	
	return( expo.scale(SUP.DATA,center=center,scale=scale) * matrix(W,nrow(SUP.DATA),length(W),byrow=TRUE) )
}

Try the ExPosition package in your browser

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

ExPosition documentation built on May 1, 2019, 7:06 p.m.