I can actually answer this!! I was trying to figure out how to use sapply for a function I wrote with multiple arguments. Suppose the function is called FUN(a,b), where "a" is a number and "b" is a number You can use mapply(FUN, a = VECTOR, b = VECTOR) where each vector is your input arguments. It will output a vector or a matrix (depending on the output of your function).
This will also work: mapply(FUN, a = VECTOR, b = NUMBER) and will apply your function with each element of "a" but the same argument for "b" each time. Let me know if it works! -- View this message in context: http://r.789695.n4.nabble.com/using-functions-with-multiple-arguments-in-the-apply-family-tp1312027p2322067.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.