Generate Array In Python Syntax If Else Statement In R