[R] lapply - function with arguments

Arun.stat arun.kumar.saha at gmail.com
Tue Apr 13 16:45:15 CEST 2010


another thought possibly

fn = function(n, a=1, b=3) return(n*(a+b))
sapply(1:3, fn)

-- 
View this message in context: http://n4.nabble.com/lapply-function-with-arguments-tp1838373p1838506.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list