R/spatial.rank.R

Defines functions `spatial.rank`

`spatial.rank` <-
function(X,shape=TRUE,na.action=na.fail,...)
    { 
    X <- na.action(X)
    X<-as.matrix(X)   

    p <- dim(X)[2]
  
    if(is.numeric(shape) & p!=1) if(!all(dim(shape)==c(p,p))) stop("'shape' is of wrong dimension")

    if (!is.numeric(shape)) {
     if(shape) shape<-rank.shape(X,...)
     else shape<-diag(p)
    }
    spatial.ranks<-ranks(X%*%mat.sqrt(solve(shape)))
    attr(spatial.ranks,"shape")<-shape
    return(spatial.ranks)
}

Try the SpatialNP package in your browser

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

SpatialNP documentation built on March 18, 2022, 8:02 p.m.