Check if a Factor is an Ordered Factor in R Programming - is.ordered() Function Last Updated : 08 Nov, 2021 Comments Improve Suggest changes Like Article Like Report is.ordered() function in R Programming Language is used to check if the passed factor is an ordered factor. Syntax: is.ordered(factor) Parameters: factor: Factor to be checkedis.ordered() Function in R Programming ExampleExample 1: Demonestration of R - is.ordered() Function R # Creating a vector x<-c("female", "male", "male", "female") # Converting vector into factor gender <- factor(x) # Using is.ordered() Function # to check if a factor is ordered is.ordered(gender) Output: [1] FALSE Example 2: R # creating vector size size = c("small", "large", "large", "small", "medium", "large", "medium", "medium") sizes <- ordered(c("small", "large", "large", "small", "medium")) # ordering the levels sizes <- ordered(sizes, levels = c("small", "medium", "large")) # Checking if the factor is ordered # using is.ordered() function is.ordered(sizes) Output: [1] TRUE Comment More infoAdvertise with us Next Article Check if a Factor is an Ordered Factor in R Programming - is.ordered() Function N nidhi_biet Follow Improve Article Tags : R Language R Factor-Function Similar Reads 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 Convert an Unordered Factor to an Ordered Factor in R Programming - as.ordered() Function as.ordered() function in R Language takes an unordered factor as argument and converts it into an ordered factor. Syntax: as.ordered(factor) Parameters: factor: Unordered Factor to be converted Example 1: Python3 1== # Creating a vector x<-c("North", "North", "East", 1 min read Check if a Function is a Primitive Function in R Programming - is.primitive() Function is.primitive() function in R Language is used to check if a function is a primitive function, i.e. its either a built-in function or a special function. Syntax: is.primitive(func) Parameters: func: Function to be checked Example 1: Python3 1== # R program to illustrate # the use of is.primitive func 1 min read Convert a Vector into Factor in R Programming - as.factor() Function as.factor() function in R Programming Language is used to convert the passed object(usually Vector) into a Factor. Syntax: as.factor(object) Parameters:Â Object: Vector to be convertedas.factor() Function in R ExampleExample 1: Convert a Factor in RR # Creating a vector x<-c("female", "male", "ma 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