samedi 25 juillet 2015

Bug in `print` function in within `ifelse`

I'm wondering why ifelse(1<2,print("true"),print("false")) returns

[1] "true"
[1] "true"

whereas ifelse(1<2,"true","false") returns

[1] "true"

I don't understand why the print within ifelse returns "true" twice

Aucun commentaire:

Enregistrer un commentaire