Check if an Object is sorted or not in R Programming - is.unsorted() Function Last Updated : 24 Jun, 2020 Comments Improve Suggest changes Like Article Like Report 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) # Creating a matrix mat <- matrix(c(5, 3, 4, 2), 2, 2) # Calling is.unsorted() Function is.unsorted(x) is.unsorted(mat) Output: [1] FALSE [1] TRUE Here, the output is FALSE for vector because it is sorted and matrix is unsorted, hence the function returns TRUE for matrix. Example 2: Python3 1== # R Program to check if # an object is sorted # Creating a vector x <- c(2, 4, 2, 5, 7, 1, 3, 8, 1) x # Calling is.unsorted() Function is.unsorted(x) # Sorting the function x1 <- sort(x) x1 # Calling is.unsorted() Function is.unsorted(x1) Output: [1] 2 4 2 5 7 1 3 8 1 [1] TRUE [1] 1 1 2 2 3 4 5 7 8 [1] FALSE Comment More infoAdvertise with us Next Article Check if an Object is sorted or not in R Programming - is.unsorted() Function N nidhi_biet Follow Improve Article Tags : R Language R DataFrame-Function R Vector-Function R Object-Function R Matrix-Function +1 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 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 of Type Numeric in R Programming - is.numeric() Function is.numeric() function in R Language is used to check if the object passed to it as argument is of numeric type. Syntax: is.numeric(x) Parameters: x: Object to be checked Example 1: Python3 # R program to check if # object is of numeric type # Calling is.numeric() function is.numeric(1) is.numeric(1. 1 min read Check if the Object is a Matrix in R Programming - is.matrix() Function is.matrix() function in R Language is used to return TRUE if the specified data is in the form of matrix else return FALSE. Syntax: is.matrix(x) Parameters: x: specified matrix Example 1: Python3 # R program to illustrate # is.matrix function # Specifying some different types of arrays A <- matri 1 min read Check if an Object of the Specified Name is Defined or not in R Programming - exists() Function exists() function in R Programming Language is used to check if an object with the names specified in the argument of the function is defined or not. It returns TRUE if the object is found.Syntax: exists(name)Parameters: name: Name of the Object to be searchedExample 1: Apply exists() Function to va 2 min read Check if an Object is of Type Integer in R Programming - is.integer() Function is.integer() function in R Language is used to check if the object passed to it as argument is of integer type. Syntax: is.integer(x) Parameters: x: Object to be checked Example 1: Python3 1== # R program to check if # object is an integer # Creating a vector x1 <- 4L x2 <- c(1:6) x3 <- c( 1 min read Check if an Object is a Call in R Programming - is.call() Function is.call() function in R Language is used to determine whether x is a call or not. Syntax: is.call(x) Parameters: x: an arbitrary R object Example 1: Python3 # R program to illustrate # is.call function # Calling is.call() function is.call(call) Output: [1] FALSE Example 2: Python3 # R program to ill 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 Check if an Object is of Type Character in R Programming - is.character() Function is.character() function in R Language is used to check if the object passed to it as argument is of character type. Syntax: is.character(x) Parameters: x: Object to be checked Example 1: Python3 1== # R program to check if # object is a character # Creating a vector x1 <- 4 x2 <- c("a 1 min read Like