Thank you all for your very fast replies. I tried Henrique's method (see one of the above posts) , and it works perfectly! Thanks again! -- View this message in context: http://r.789695.n4.nabble.com/How-to-pass-selection-criteria-in-a-function-tp3067765p3067829.html Sent from the R help mailing list archive at Nabble.com.