Skip to content

vectors comparison

4 messages · Simon Knapp, Francesco Nutini

#
Your question does not seem to make sense - there is no value of -500
in Y (did you mean -10?). Anyway, I think this might work:

which(y==-10 & (x==1 | c(0, x[-length(x)]) == 1 | c(x[-1], 0) == 1))

... though one would think there is a more elegant way


On Wed, Oct 17, 2012 at 10:07 AM, Francesco Nutini
<nutini.francesco at gmail.com> wrote:
5 days later