Replace all values lower than threshold in R

前端 未结 4 1820
予麋鹿
予麋鹿 2020-12-11 03:09

I have a vector

x <- c(-1, 0, 1, 2, 3)

I want all values less than 1 to be replaced by 1.

How?

Is there a no-loop so

4条回答
提交回复
热议问题