> ...if I had the closing prices of the > S&P from 01/01/1990-12/31/1990, how could I get the average price of > the S&P from 02/01/1990-03/15/1990? Or the average price of the S&P on > Mondays (assuming a dummy var is created for 1 = Monday, 0 = else).
tapply has already been referred to. You may also find aggregate() useful, as it gives you back a data frame that includes the conditioning variables if you tell it to. Alse ave, if you want to do something like mean-centring a data set based on group means rather than the grad mean. S Ellison ******************************************************************* This email and any attachments are confidential. Any use...{{dropped:8}} ______________________________________________ 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.