Find value within a range in R

老子叫甜甜 提交于 2020-12-27 05:52:23

问题


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

value 
1  
35  
36  
37  
350  
355  
3555  
35555

回答1:


To select the values: value[value >= 35 & value <=350]

To replace them with withinrange: value[value >= 35 & value <=350] <- withinrange



来源:https://stackoverflow.com/questions/44954507/find-value-within-a-range-in-r

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!