Consider the following:
seq(from=10,to=30)[c(4,8)]
[1] 13 17
seq(from=10,to=30)[c(NA,8)]
[1] NA 17
seq(from=10,to=30)[c(NA,NA)]
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
To me the result of the latter is inconsistent with how the other two examples are handled by R and has cost me quite unpleasant debugging pains.
Might this be considered a bug?
See Question&Answers more detail:os