4

What's the R way of doing (in Python numpy)

np.where(b > 0, a, a+1)

for equal length numeric vectors a and b?

jf328
  • 6,841
  • 10
  • 58
  • 82

1 Answers1

5

I think:

ifelse(b > 0, a, a+1)

?

Lennyy
  • 5,932
  • 2
  • 10
  • 23