I\'m attempting to independently select elements of an array that meet a condition and then convert those elements to a different value, with a given frequency. In R I\'d u