Skip to content
Prev 267311 / 398503 Next

if function problems

On Aug 1, 2011, at 6:57 PM, zoe_zhang wrote:

            
Just use logical indexing

x[ x>0 ] <- 0
'if' is not the right function. Look at

?"if"
?ifelse

(But the logical indexing is easier in this case than using ifelse.)