I am new user in R. How can I check which elements of the vector A is between the elements of vector B for example:
A = c(1.1,
Try this:
data.frame(A,cut(A,B))
For each observation in A, it tells you which pair of B observations it's between.
Like so:
> data.frame(A,cut(A,B))
A cut.A..B.
1 1.1 (1,2]
2 3.2
3 5.0
4 8.5
5 4.6
6 2.2 (2,3]
NA means it isn't between two B observations.
Also try:
data.frame(A,cut(A,c(-Inf,B,Inf)))