I would like to check the elements of vector a is between the elements of vector b or not in R. How can I do this ? Means that is 3 between 2 and 4 and if yes appear in result, if not do not appear. Just mentiond that I dont want to check the first and last element of vector a. The result should be just 3.
a = c(1, 3, 8, 12)
b = c(0, 2, 4, 6, 8)
why don’t you just use a loop?