R/scaling.R

Defines functions scaling

Documented in scaling

scaling <-
function(Y, type="none")
{
   if(type == "pareto")
   {
   	 sdev<-as.matrix(apply(Y,2,sd))
     Y<-sweep(Y,2,sqrt(sdev),"/")             ## Pareto scale Y.
    }
    if(type == "unit")
    {
     Var<-as.matrix(apply(Y,2,var))
     Y<-sweep(Y,2,sqrt(Var),"/")              ## Unit scale Y.
    }
   return(Y)
}

Try the MetabolAnalyze package in your browser

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

MetabolAnalyze documentation built on Aug. 31, 2019, 5:05 p.m.