[R] partially sum variable of a dataframe

mdgi at gmx.ch mdgi at gmx.ch
Wed Nov 7 15:11:00 CET 2007


Hello,

A stupid question:

I have an array with two columns, the first "a" acting as my index in 0.25 steps, the second one "b" the column of interest. How can i sum up "b" only for a specified window in "a" (as the window command for time series)

a=seq(0,10,0.25)
b=runif(41)
c=data.frame(a,b)

Sum up c if 3<a<5.25

How to do that? thanks

marc
-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger



More information about the R-help mailing list