Get or Set the Type of an Object in R Programming - mode() Function Last Updated : 19 Jun, 2020 Comments Improve Suggest changes Like Article Like Report mode() function in R Language is used to get or set the type or storage mode of an object. Syntax: mode(x) mode(x) <- value Here "value" is the desired mode or ‘storage mode’ (type) of the object Parameters: x: R object Example 1: Python3 # R program to illustrate # mode function # Initializing some values x <- 3 y <- "a" # Calling the mode() function mode(x) mode(y) Output: [1] "numeric" [1] "character" Example 2: Python3 # R program to illustrate # mode function # Initializing some values x <- 3 y <- "a" # Calling mode() function to # set the storage mode of the object mode(x) <- "character" mode(y) <- "numeric" # Getting the assigned storage mode mode(x) mode(y) Output: [1] "character" [1] "numeric" Comment More infoAdvertise with us Next Article Get or Set the Type of an Object in R Programming - mode() Function K Kanchan_Ray Follow Improve Article Tags : R Language R Object-Function Similar Reads Get the number of columns of an Object in R Programming - ncol() Function ncol() function in R Language is used to return the number of columns of the specified matrix. Syntax: ncol(x)Parameters: x: matrix, vector, array or data frame  Example 1:  Python3 # R program to illustrate # ncol function # Getting R Biochemical Oxygen Demand Dataset BOD # Calling ncol() functi 1 min read Get or Set names of Elements of an Object in R Programming - names() Function names() function in R Language is used to get or set the name of an Object. This function takes object i.e. vector, matrix or data frame as argument along with the value that is to be assigned as name to the object. The length of the value vector passed must be exactly equal to the length of the obj 2 min read Display the internal Structure of an Object in R Programming - str() Function str() function in R Language is used for compactly displaying the internal structure of a R object. It can display even the internal structure of large lists which are nested. It provides one liner output for the basic R objects letting the user know about the object and its constituents. It can be 3 min read Get or Set Levels of a Factor in R Programming - levels() Function levels() function in R Language is used to get or set the levels of a factor. Syntax: levels(x) Parameters: x: Factor Object Example 1: Python3 1== # R program to get levels of a factor # Creating a factor gender <- factor(c("female", "male", "male", "female 1 min read Search and Return an Object with the specified name in R Programming - get() Function get() function in R Language is used to return an object with the name specified as argument to the function. This is another method of printing values of the objects just like print function. This function can also be used to copy one object to another. Syntax: get(object) Parameters: object: Vecto 1 min read Like