https://github.com/cran/emplik
Revision a09ab78cfdae5c86da702f74c604cda1abde8ddf authored by Mai Zhou on 08 August 1977, 00:00:00 UTC, committed by Gabor Csardi on 08 August 1977, 00:00:00 UTC
1 parent 1d6b37a
Tip revision: a09ab78cfdae5c86da702f74c604cda1abde8ddf authored by Mai Zhou on 08 August 1977, 00:00:00 UTC
version 0.5-1
version 0.5-1
Tip revision: a09ab78
Wdataclean2.R
Wdataclean2 <- function (z, d, wt = rep(1,length(z)) )
{ niceorder <- order(z,-d)
sortedz <- z[niceorder]
sortedd <- d[niceorder]
sortedw <- wt[niceorder]
n <- length(sortedd)
y1 <- sortedz[-1] != sortedz[-n]
y2 <- sortedd[-1] != sortedd[-n]
y <- y1 | y2
ind <- c(which(y | is.na(y)), n)
csumw <- cumsum(sortedw)
list( value = sortedz[ind], dd = sortedd[ind],
weight = diff(c(0, csumw[ind])) )
}
##########################################################
# this function sorts the data, and collaps them
# if there are true tie. and number of tie counted in wt
##########################################################
Computing file changes ...