You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
would you agree if fifelse(c(TRUE, FALSE), 1:2, list(0L)) displays an error like this :
Error in fifelse(c(TRUE, FALSE), 1:2, list(0L)) :
'yes' is of type integer but 'no' is of type list. Please make sure that both arguments have the same type.
So for len1 > 1 or len2 > 1 branches raise an error.
I would personally avoid this kind of inconsistency, but lets wait for opinion of others. I also think wrapping in a list for values to meant to be a list column elements is not bad.
Yes that is correct. This is consistent with what @MichaelChirico asked me to implement in my pull request. @jangorecki would you avoid en-listing or how would you expect en-listing to work?
Thanks for implementing this. dplyr::if_else() has a missing argument I think it's quite helpful, because the number of all the possible logic values in R are 3, in fact: TRUE, FALSE, NA.
So do you think it's a good idea to add the missing argument in fifelse()?
Activity
2005m commentedon Aug 3, 2019
would you agree if
fifelse(c(TRUE, FALSE), 1:2, list(0L))displays an error like this :and that we have the following ?
Let me know if you want me to test something else. I don't want to commit anything until you are happy with the behaviour.
jangorecki commentedon Aug 3, 2019
So for
len1 > 1orlen2 > 1branches raise an error.I would personally avoid this kind of inconsistency, but lets wait for opinion of others. I also think wrapping in a
listfor values to meant to be a list column elements is not bad.2005m commentedon Aug 3, 2019
Yes that is correct. This is consistent with what @MichaelChirico asked me to implement in my pull request. @jangorecki would you avoid en-listing or how would you expect en-listing to work?
shrektan commentedon Aug 9, 2019
Thanks for implementing this.
dplyr::if_else()has amissingargument I think it's quite helpful, because the number of all the possible logic values in R are 3, in fact:TRUE,FALSE,NA.So do you think it's a good idea to add the
missingargument infifelse()?Thanks.