Performing Operations on Multiple Lists simultaneously in R Programming - mapply() Function Last Updated : 08 Nov, 2021 Comments Improve Suggest changes Like Article Like Report mapply() function in R Language is stand for multivariate apply and is used to perform mathematical operations on multiple lists simultaneously. Syntax: mapply(func, list1, list2, ...) Parameters: list1, list2, ...: Created Listsfunc: operation to be appliedmapply() Function in R Language ExampleExample 1: Sum of two lists using mapply() function in R R # R program to illustrate # mapply() function # Creating a list A = list(c(1, 2, 3, 4)) # Creating another list B = list(c(2, 5, 1, 6)) # Applying mapply() result = mapply(sum, A, B) print(result) Output: [1] 24Example 2: Product of two lists using mapply() function in R R # R program to illustrate # mapply() function # Creating a list A = list(c(1, 2, 3, 4)) # Creating another list B = list(c(2, 5, 1, 6)) # Applying mapply() result = mapply(prod, A, B) print(result) Output: [1] 1440Example 3: mapply() function with multiple arguments R Data1 <- c(1,2,3) Data2 <- c(10,20,30) mult_one<-function(Data1,Data2) { Data1+Data2 } mapply(mult_one,Data1,Data2) Output: 11 22 33 Comment More infoAdvertise with us Next Article Performing Operations on Multiple Lists simultaneously in R Programming - mapply() Function N nidhi_biet Follow Improve Article Tags : R Language R List-Function Similar Reads Operations on Lists in R Programming Lists in R language, are the objects which comprise elements of diverse types like numbers, strings, logical values, vectors, list within a list and also matrix and function as its element. A list is generated using list() function. It is basically a generic vector that contains different objects. R 4 min read Convert an Object to List in R Programming - as.list() Function as.list() function in R Programming Language is used to convert an object to a list. These objects can be Vectors, Matrices, Factors, and dataframes. Syntax: as.list(object) Parameters: object: Vector, Matrix, factor, or data frame R - as.list() Function ExampleExample 1: Converting Vector to list 2 min read Applying a Function over an Object in R Programming - sapply() Function sapply() function in R Language takes list, vector or data frame as input and gives output in vector or matrix. It is useful for operations on list objects and returns a list object of same length of original set. Syntax: sapply(X, FUN) Parameters: X: A vector or an object FUN: Function applied to e 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 Recursively apply a Function to a List in R Programming - rapply() function rapply() function in R Language is used to recursively apply a function to a list. Syntax: rapply(object, f, classes = "ANY", deflt = NULL, how = c("unlist", "replace", "list")) Parameters: object: represents list or an expression f: represents function to be applied recursively classes: represents 3 min read Apply a Function over a Ragged Array in R Programming - tapply() Function tapply() function in R Language is used to apply a function over a subset of vectors given by a combination of factors Syntax: tapply(vector, factor, fun) Parameters: vector: Created Vector factor: Created Factor fun: Function to be applied Example 1: Python3 1== # R Program to apply a function # ov 1 min read How to perform multiplication in R Multiplication is a fundamental arithmetic operation that is essential in various fields, including data analysis, statistics, and machine learning. The R Programming Language provides robust support for performing multiplication, whether it's simple scalar multiplication, element-wise multiplicatio 3 min read Convert an Object to Data Frame in R Programming - as.data.frame() Function as.data.frame() function in R Programming Language is used to convert an object to data frame. These objects can be Vectors, Lists, Matrices, and Factors. Syntax: as.data.frame(object) Parameters: object: Vector, Matrix, factor, or data frameR - as.data.frame() Function ExampleExample 1: Basic exam 2 min read How to Write Multiple Excel Files From Column Values - R programming A data frame is a cell-based structure comprising rows and columns belonging to the same or different data types. Each cell in the data frame is associated with a unique value, either a definite value or a missing value, indicated by NA. The data frame structure is in complete accordance with the Ex 6 min read Looping over Objects in R Programming One of the biggest issues with the âforâ loop is its memory consumption and its slowness in executing a repetitive task. When it comes to dealing with a large data set and iterating over it, a for loop is not advised. In this article we will discuss How to loop over a list in R Programming Language 5 min read Like