R/normalize.R

Defines functions normalize

Documented in normalize

normalize <-
function(sim) {
  # 各行ごとに平均0, 標準偏差1に正規化する
  meanVec <- apply(sim,1,mean,na.rm = TRUE)
  sdVec <- apply(sim,1,sd,na.rm = TRUE)
  sim <- t(scale(t(sim),meanVec,sdVec))
  return(sim)
}

Try the smdc package in your browser

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

smdc documentation built on May 29, 2017, 11:45 a.m.