I'd use plyr
for this. Something like this should get you a data.frame
with the median per month:
library(plyr)
result_df = ddply(a, .(Date), summarize, median_value = median(Value))
plyr
is known to be a little slow for larger datasets, but I would just give the code above a try. A very good alternative is data.table
, which provides roughly the same functionality, but then orders of magnitude faster.