Search notes:

R function: mapply

mapply(func, vec1, vec2, … vecش) calls the given function n times. In the mth invocation, the the arguments of func are set to the mth element of the vector vecₘ.
In the following example, a function is defined that takes three arguments. Then, mapply is invoked. It is passed the function plus vectors. mapply will then call the function with the argumments (1, 1, 5), (4, 2, 0), (0, 3, 4) and (6, 0, 3):
func <- function(a, b, c) {
  a*b + c
}

mapply(func,
  c(1, 4, 0, 6),
  c(1, 2, 3, 0),
  c(5, 0, 4, 3)
);
#
#  6 8 4 3
Github repository about-r, path: /functions/mapply.R

See also

Other apply functions
Index to (some) R functions

Index