R/standardize.R

standardizeX <- function(X){
	n <- nrow(X)
	p <- ncol(X)
	Xc <- apply(X,2,mean)
	X  <- sweep(X,2,Xc,FUN="-")
	Xs <- apply(X,2,sd)
	X  <- sweep(X,2,Xs,FUN="/")
	return(list(X,Xc,Xs))
}

Try the glmgraph package in your browser

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

glmgraph documentation built on May 1, 2019, 7:04 p.m.