[R] Problem with the aggregate command

2007-09-07 Thread Anup Nandialath
Dear friends, I have a data set with 23 columns and 38000 rows. It is a panel running from the years 1991 through 2005. I want to aggregate the data and get the medians of each of the 23 columns for each of the years. In other words my output should be like this Year Median 1991

[R] Problem with the Aggregate command (PS)

2007-09-07 Thread Anup Nandialath
Dear Friends, I forgot to add, the idea is to aggregate the entire dataset based on year and get the median value for each of the columns. Hence the output should be like this YearX1 X2X3 ... 1991102030... 199230 2010... 1993

Re: [R] Problem with the aggregate command

2007-09-07 Thread jim holtman
Your 'lst' is not the same length as either set1 or set2. If one of your columns in the dataframe is the year, then you should have: aggregate(set1, set1$year, median) On 9/7/07, Anup Nandialath [EMAIL PROTECTED] wrote: Dear friends, I have a data set with 23 columns and 38000 rows. It is a