Replace Values in Vector on Specific Place in R
You have a data frame with 4 columns, each columns has 25 rows. You want to replace every 5th element with an outlying value (the mean of the column).

apply(x,2,function(i){
    i[seq(5,25,5)]=i[seq(5,25,5)]+mean(i)
})