On Sun, 20 Dec 2020 at 06:22, Richard O'Keefe <[email protected]> wrote:
> More accurately, in x[i] where x and i are simple vectors,
> i may be a mix of positive integers and zeros
> where the zeros contribute nothing to the result
>
Yes, index 0 doesn't get an error or a warning. I think it should.
Eg.
(v <- 1:4)
[1] 1 2 3 4
v[c(0,2,4)] <- c(0,2)
v
[1] 1 0 3 2 # a surprise ?
Regards
Martin
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.