Check for the Existence of a Vector Object in R Programming - is.vector() Function Last Updated : 19 Jun, 2020 Comments Improve Suggest changes Like Article Like Report is.vector() function in R Language is used to return TRUE if the given vector is of the specified mode having no attributes other than names. It returns FALSE otherwise. Syntax: is.vector(x, mode = "any") Parameters: x: R object mode: character string naming an atomic mode or "list" or "expression" or "any" Example 1: Python3 # R program to illustrate # is.vector function # Initializing some data types x <- c(a = 1, b = 2) y <- list(c("GFG", "gfg"), matrix(c(1, 2, 3))) z <- "Geeks" # Calling is.vector() function is.vector(x) is.vector(y) is.vector(z) Output: [1] TRUE [1] TRUE [1] TRUE Example 2: Python3 # R program to illustrate # is.vector function # Initializing some data types x <- c(a = 1, b = 2) y <- list(c("GFG", "gfg"), matrix(c(1, 2, 3))) z <- "Geeks" # Calling is.vector() function is.vector(x, mode = "list") is.vector(x, mode = "expression") is.vector(x, mode = "any") is.vector(y, mode = "list") is.vector(y, mode = "expression") is.vector(y, mode = "any") is.vector(z, mode = "list") is.vector(z, mode = "expression") is.vector(z, mode = "any") Output: [1] FALSE [1] FALSE [1] TRUE [1] TRUE [1] FALSE [1] TRUE [1] FALSE [1] FALSE [1] TRUE Comment More infoAdvertise with us Next Article Check for the Existence of a Vector Object in R Programming - is.vector() Function K Kanchan_Ray Follow Improve Article Tags : R Language R Vector-Function Similar Reads Convert an Object into a Vector in R Programming - as.vector() Function as.vector() function in R Language is used to convert an object into a vector. Syntax: as.vector(x) Parameters: x: Object to be converted Example 1: Python3 1== # R program to convert an object to vector # Creating an array x <- array(c(2, 3, 4, 7, 2, 5), c(3, 2)) x # Calling as.vector() Function 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 for a Pattern in the Vector in R Programming - grepl() Function grepl() function in R Language is used to return the value True if the specified pattern is found in the vector and false if it is not found. Syntax: grepl(pattern, string, ignore.case=FALSE) Parameters: pattern: regular expressions pattern string: character vector to be searched ignore.case: whethe 1 min read Check if an Object is of Complex Data Type in R Programming - is.complex() Function is.complex() function in R Language is used to check if the object passed to it as argument is of complex data type. Syntax: is.complex(x) Parameters: x: Object to be checked Example 1: Python3 # R program to check if # object is of complex type # Calling is.complex() function is.complex(1 + 0i) is. 1 min read Convert values of an Object to Logical Vector in R Programming - as.logical() Function as.logical() function in R Language is used to convert an object to a logical vector. Syntax: as.logical(x)Parameters:Â x: Numeric or character object R - as.logical() Function ExampleExample 1: Basic example of as.logical() Function in R Programming Language.R # R Program to convert # an object to l 1 min read Like