Thanks all. I will try to use both tapply and by, and have no idea how I missed the by function. Thanks again. -- View this message in context: http://www.nabble.com/Equivalent-to-a-BY-command-in-SAS-tp16670452p16676280.html Sent from the R help mailing list archive at Nabble.com.