标签: r range data-manipulation
我的数据如下所示。我想选择大于/等于35且小于/等于350的值。我还想用withinrange替换这些值
withinrange
value 1 35 36 37 350 355 3555 35555
答案 0 :(得分:0)
选择值:value[value >= 35 & value <=350]
value[value >= 35 & value <=350]
要将其替换为withinrange:value[value >= 35 & value <=350] <- withinrange
value[value >= 35 & value <=350] <- withinrange