My data look like below. I want to select value greater/equal to 35 and less than/equal to 350. I also want to replace those values with withinrange
withinrange
To select the values: value[value >= 35 & value <=350]
value[value >= 35 & value <=350]
To replace them with withinrange: value[value >= 35 & value <=350] <- withinrange
value[value >= 35 & value <=350] <- withinrange