how i can do comparison of matrix of rows=10 and col=2 with other matrix (10,2)

x=runif(10,1,15) # random x coord
y=runif(10,1,15) # random y coord
a=runif(10,1,15)
b=runif(10,1,15)
x=as.integer(x)
y=as.integer(y)
a=as.integer(a)
b=as.integer(b)
onlineloc=cbind(x,y)
instore=cbind(a,b)

if(instore==onlineloc)
print(1)
else
print=0

I assume that you want the conditional statement to return TRUE if the instore matrix is identical to the onlineloc matrix and FALSE otherwise? There are a couple of ways to accomplish this, using all or identical.

all(instore == onlineloc)
[1] FALSE

or

identical(instore, onlineloc)
[1] FALSE

Using identical is a bit cleaner.

x=runif(10,1,15) # random x coord
y=runif(10,1,15) # random y coord
a=runif(10,1,15)
b=runif(10,1,15)
x=as.integer(x)
y=as.integer(y)
a=as.integer(a)
b=as.integer(b)
onlineloc=cbind(x,y)
instore=cbind(a,b)

if (identical(instore, onlineloc)) print(1)  else print(0)
[1] 0