If, as a new R user, you find the help page difficult to follow then Google offers plenty of support to understand the apply function
e.g. http://www.ats.ucla.edu/stat/r/library/advanced_function_r.htm http://www.slideshare.net/dataminingtools/r-apply-functions http://nsaunders.wordpress.com/2010/08/20/a-brief-introduction-to-apply-in-r/ HTH Pete -- View this message in context: http://r.789695.n4.nabble.com/function-tp3168116p3168352.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.