rgrannell1 / kea

Composable Functional Programming in R
16 stars 3 forks source link

xChoose fails for list(NA) #99

Closed rgrannell1 closed 9 years ago

rgrannell1 commented 9 years ago
xChoose(list(NA), 1)
Error in if (length(num) == 0 || num == 0) { : 
  missing value where TRUE/FALSE needed
rgrannell1 commented 9 years ago

Fixed by moving some assertions to the top of the function.

Error: value_error
The argument matching “num” must not be NA or NaN; it must be an element of the set {-Inf, ..., -1, 0, +1, ..., +Inf}
Thrown from xChoose
In the call xChoose(list(NA), 1:5)