[R] Is this a bug?

Luca Braglia lbraglia at gmail.com
Tue Apr 17 21:18:47 CEST 2007


On 17/04/07 -  14:59, Roland Rau wrote:
> On 4/17/07, Luca Braglia <lbraglia a gmail.com> wrote:

> >ifelse(T,1+1,1+2)
> [1] 2
> >ifelse(F,1+1,1+2)
> [1] 3
> >ifelse(T,"hello","goodbye")
> [1] "hello"
> >ifelse(F,"hello","goodbye")
> [1] "goodbye"
> >ifelse(T,print("hello"),print("goodbye"))
> [1] "hello"
> [1] "hello"
> >ifelse(F,print("hello"),print("goodbye"))
> [1] "goodbye"
> [1] "goodbye"
> >ifelse(T,print(1+1),print(1+2))
> [1] 2
> [1] 2
> >ifelse(F,print(1+1),print(1+2))
> [1] 3
> [1] 3



Thank you , Weiwei and Roland, all right now: I was thinking wrong!

bye

	Luca



More information about the R-help mailing list