Hello Frank, does the following example, what you want? Thomas P. ## some test data x <- data.frame(matrix(rnorm(72*10, mean=50, sd=20), ncol=10)) me <- colMeans(x) sd <- apply(x, 2, sd) coff <- me + 2*sd # see ?t and ?pmax x2 <- t(pmin(t(x),coff)) # test it x-x2