#' computes the projection matrix
#'
#' @param X A matrix of any dimension
#' @return Returns a square matrix
#' @export
proj <- function(X){
if(!class(X)=="matrix") X <- as.matrix(X)
return(X%*%matpower(crossprod(X),-1)%*%t(X))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.