y <- rnorm(100, mean=40, sd=20)
y <- apply(cbind(y[1:99], y[2:100]), 1, max)
bl <- rep(1:3, each=33)
ydc <- decluster(y, quantile(y, probs=c(0.95)), r=1, blocks=bl)
yorig <- datagrabber(ydc)
all(y - yorig == 0)
Run the code above in your browser using DataLab