On Fri, Nov 5, 2010 at 11:54 AM, Santosh Srinivas <santosh.srini...@gmail.com> wrote: > Thanks Gabor for pointing in the right direction. > Looked up cycle and the doc is tough to understand " cycle gives the > positions in the cycle of each observation." ... how is cycle defined. > > I just extended your idea to make it readable for an avg. user in the > following way > mRet[format(index(mRet),"%m")==11] >
cycle is defined in the core of R and is extended for additional methods by zoo. For a zoo object applying cycle to zoo applies it to the zoo object's index. If the index is a yearmon object, ym, then cycle(ym) gives the month number at each time, 1 for Jan, 2 for Feb, etc. If the index is a yearqtr object, yq, then cycle(yq) gives the quarter number at each time, 1 for Q1, 2 for Q2, etc. For a zooreg object cycle will give the position in the cycle at each time. If the zooreg object has frequency F then the cycle values will be 1, 2, ..., F. -- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.