Displaying 1 result from an estimated 1 matches for "max_daily".
Did you mean:
maildaily
2011 Jun 13
1
maintaining row connections during aggregate
...looking to obtain the minimum and maximum values for each year, but also know on which julian day ("jday") they occurred.
I can get the maximum value for each year with:
> mx = aggregate(ddat$avg_m3s, list(Year=ddat$year), max, na.rm=T)
> colnames(mx) <- c("year","max_daily")
year max_daily
1 1960 60.24615
2 1961 73.90000
3 1962 56.40000
...
But I want to output the max with the corresponding day on which it occurred, such as:
year jday avg_m3s
1 1960 136 60.24615
2 1961 129 73.90000
3 1962 111 56.40000
I haven't been able to determi...