From ruipb@rr@d@@ @ending from @@po@pt  Sat Aug  4 15:32:31 2018
From: ruipb@rr@d@@ @ending from @@po@pt (Rui Barradas)
Date: Sat, 4 Aug 2018 14:32:31 +0100
Subject: [Rd] Is this a bug in `[`?
Message-ID: <4cf085ac-8f7e-38b5-ea02-302df94ad7b5@sapo.pt>

Hello,

Maybe I am not understanding how negative indexing works but

1) This is right.

(1:10)[-1]
#[1]  2  3  4  5  6  7  8  9 10

2) Are these right? They are at least surprising to me.

(1:10)[-0]
#integer(0)

(1:10)[-seq_len(0)]
#integer(0)


It was the last example that made me ask, seq_len(0) whould avoid an 
if/else or something similar.


Thanks in advance,

Rui Barradas



[Rd] Is this a bug in `[`?
Rui Barradas