Return an Object with the specified name in R Programming - get0() and mget() Function Last Updated : 23 Jun, 2020 Comments Improve Suggest changes Like Article Like Report In R programming, get0() and mget() function works similar to get() function. It is used to search and return the object with the specified name passed to it as argument. get0() Function get0() function has the same syntax as get() function but there is an addition of a new parameter which returns an output if the data object is not found. Clearly, this is making user-generated exception in a way. Syntax: get0(x, mode, ifnotfound) Parameters: x: represents data object to be searched mode: represents type of data object ifnotfound: represents the output that has to be returned when x is not found Example: r # Define data objects x <- c(1, 2, 3) y <- c("a", "b", "c") # Searching using get0() function get0("x", ifnotfound = "not found") get0("x1", ifnotfound = "not found") Output: [1] 1 2 3 [1] "not found" mget() function mget() function in R programming works similar to get() function but, it is able to search for multiple data objects rather than a single object in get() function. Syntax: mget(x, mode, ifnotfound) Parameters: x: represents character vector of object names mode: represents type of data object ifnotfound: represents the output that has to be returned when x is not found Example: r # Defining data objects x <- c(1, 2, 3) y <- c("a", "b", "c") # Searching using mget() function mget(c("x", "y", "x1"), ifnotfound = "Not Found") Output: $x [1] 1 2 3 $y [1] "a" "b" "c" $x1 [1] "Not Found" Comment More infoAdvertise with us Next Article Return an Object with the specified name in R Programming - get0() and mget() Function U utkarsh_kumar Follow Improve Article Tags : R Language R Object-Function Similar Reads 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 Get or Set the Type of an Object in R Programming - mode() Function 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 # Init 1 min read Get the number of rows of an Object in R Programming - nrow() Function nrow() function in R Language is used to return the number of rows of the specified matrix. Syntax: nrow(x)Parameters: x: matrix, vector, array or data frame  Example 1:  Python3 # R program to illustrate # nrow function # Getting R Biochemical Oxygen Demand Dataset BOD # Calling nrow() function 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 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 Like