Check if Two Objects are Equal in R Programming - setequal() Function Last Updated : 15 Jun, 2020 Comments Improve Suggest changes Like Article Like Report setequal() function in R Language is used to check if two objects are equal. This function takes two objects like Vectors, dataframes, etc. as arguments and results in TRUE or FALSE, if the Objects are equal or not. Syntax: setequal(x, y) Parameters: x and y: Objects with sequence of items Example 1: Python3 1== # R program to illustrate # the use of setequal() function # Vector 1 x1 <- c(1, 2, 3, 4, 5, 6) # Vector 2 x2 <- c(1:6) # Vector 3 x3 <- c(2, 3, 4, 5, 6) # Calling setequal() Function setequal(x1, x2) setequal(x1, x3) Output: [1] TRUE [1] FALSE Example 2: Python3 1== # R program to illustrate # the use of setequal() function # Data frame 1 data_x <- data.frame(x1 = c(5, 6, 7), x2 = c(2, 2, 2)) # Data frame 2 data_y <- data.frame(y1 = c(5, 6, 7), y2 = c(2, 2, 2)) # Calling setequal() Function setequal(data_x, data_y) Output: [1] TRUE Comment More infoAdvertise with us Next Article Check if Two Objects are Equal in R Programming - setequal() Function N nidhi_biet Follow Improve Article Tags : R Language R DataFrame-Function R Vector-Function R Object-Function R Matrix-Function R Array-Functions +2 More Similar Reads Check if an Object is a Table in R Programming - is.table() Function is.table() function in R Language is used to check if an object is a table. Syntax: is.table(x) Parameters: x: Object to be checked Example 1: Python3 1== # R Program to check # if an object is a table # Creating a vector vec = c(2, 4, 3, 1, 2, 3, 2, 1, 4, 2) # calling is.table() Function is.table(v 1 min read Compare two Objects for Equality in R Programming - identical() Function identical() function in R Language is used to return TRUE when two objects are equal else return FALSE. Syntax: identical(a, b)Parameters: a, b: specified two objects  Example 1:  Python3 # R program to illustrate # identical function # Calling the identical() function identical(factorial(3), gamm 2 min read Check if the Object is a List in R Programming - is.list() Function is.list() function in R Language is used to return TRUE if the specified data is in the form of list, else returns FALSE. Syntax: is.list(X) Parameters: x: different types of data storage Example 1: Python3 # R program to illustrate # is.list function # Initializing some list a <- list(1, 2, 3) b 1 min read Check if an Object is sorted or not in R Programming - is.unsorted() Function is.unsorted() function in R Language is used to check if an object is sorted or not. It returns False if the object is sorted otherwise True. Syntax: is.unsorted(x) Parameters: x: Object Example 1: Python3 1== # R Program to check if # an object is sorted # Creating a vector x <- c(1:9) # Creatin 1 min read Checking if the Object is a Factor in R Programming - is.factor() Function is.factor() function in R Language is used to check if the object passed to the function is a Factor or not. It returns a boolean value as output. Syntax: is.factor(Object) Parameters: Object: Object to be checked Example 1: Python3 1== # Creating a vector x<-c("female", "male 1 min read Like