Re: [R] A complicated 'aggregate'
Use wtd.mean from Hmisc and by: Lines <- " 11:00:0134 1000 11:00:0135 500 11:00:0135 1000 11:00:0234 500 11:00:0235 500 " library(Hmisc) # for wtd.mean library(zoo) library(chron) # replace with DF <- read.table("mytable.dat")
[R] A complicated 'aggregate'
Hi, I have a financial (zoo) time series with prices and volumes (although I can get the coredata as a matrix). Due to the data-source some indices have multiple observations. I want to aggregate these according to a weighted average. 11:00:0134 1000 11:00:0135 500 11:0