I have created two variable and I want to know that how I can check that this two variable are similar or identical I want to know because if variable of large size then how I can check this are identical
for example
x<-2
y<-3
I know that they are not identical but I want to know how we can check this in R
Hi @sid100158,
I am not exactly sure about your ques but are you trying for something like this:
.
Also in case you would like to save the result into a vector:

Hope this helps!!
Use the identical function.
x <- 1:30
y <- 1:30
identical(x,y)
--> TRUE
x <- 1:30
y <- 2:31
identical(x,y)
--> FALSE
1 Like
I personally usually make use of the duplicated-function:
x <- 1:30
y <- 1:30
z <- c(x,y)
table(duplicated(z))
y <- 31:60
z <- c(x,y)
table(duplicated(z))