If I do the following to a string of letters:
x <- 'broke'
y <- nchar(x)
z <- sequence(y)
How do I store every value of the z
that isn't the first, last, or middle values of the sequence.
In this example if z
is 1 2 3 4 5
then the desired output would be 2 4
in the case of 1 2 3 4
nothing would be stored however, In the case of say 1 2 3 4 5 6
, 2
and 5
would be stored and so on