R/StartEnd.R

Defines functions StartEnd

Documented in StartEnd

StartEnd <-
function(alpha)
{

n = nrow(alpha)

startend = matrix(0, n, 2)

cusum = apply(alpha, 1, cumsum)  

for(i in 1:n)

{

startend[i,1] = which(cusum[,i] == 1, arr.ind=T)[1]

startend[i,2] = which(cusum[,i] == max(cusum[,i]), arr.ind=T)[1]
}

startend

}

Try the glrt package in your browser

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

glrt documentation built on May 2, 2019, 8:31 a.m.