[R] Read time series

2009-09-20 Thread Alexis Maluendas
Hi R experts, How can I get a ts object from a data frame object which contains a daily time series in order to apply it time series functions? Tanks Aleto [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] Calculate weighted mean for each group

2009-07-23 Thread Alexis Maluendas
Hi R experts, I need know how calculate a weighted mean by group in a data frame. I have tried with aggragate() function: data.frame(x=c(15,12,3,10,10),g=c(1,1,1,2,2,3,3),w=c(2,3,1,5,5,2,5)) - d aggregate(d$x,by=list(d$g),weighted.mean,w=d$w) Generating the following error: Error en