R/diss_index.R

Defines functions .my.det .raw.i .calc.j diss.index

Documented in diss.index

.my.det <- function(n, index){

    return((2 * n - 3) ^ 2 + 8 * (n - index));
}

.raw.i <- function(n, index){

    return(n + 1/2 - sqrt(.my.det(n,index)) / 2);
}

.calc.j <- function(i,n,index){

    return(index + n + i * (0.5 * (i + 1) - n));
}

diss.index <- function(index, N){

    i <- floor(.raw.i(N, index));

    return(c(i = i,
             j = .calc.j(i,N,index)));
}

Try the dissUtils package in your browser

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

dissUtils documentation built on May 1, 2019, 7:28 p.m.