Suppose have a data frame `df` and column `foo` is float. I want to assign `foo` to be 1, if the value of `foo` is more than one. Wondering if any efficient way to implement in R? If there is a one line implementation, it will be great, similar to lambda expression in Python. Thanks.