R/snlsvec.R

Defines functions snlsvec

snlsvec <- function(X){
  
  temp <- matrix(rep(TRUE,ncol(X)*nrow(X)),nrow=nrow(X))
  Utri <- temp[upper.tri(temp,diag=TRUE)]
  Ustri <- temp[upper.tri(temp,diag=FALSE)]
  
  x <- X
  x[Ustri] <- sqrt(2) * x[Ustri]
  x <- x[Utri]
  
  return(x)
}

Try the Datasmith package in your browser

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

Datasmith documentation built on May 29, 2017, 10:19 p.m.