Hi, Premises: I have a database which contain the list of events and their time stamps (This is a Unix time stamps) What I want to do : I want know how much is the maximum occurrence of this in any a time period of 7 days or does a event occur es more than "N" (say 5) times in a period of 7 days. This time period is not fixed with "week boundary", its a period of 7 days occurring at any time. Question : How it can be done in R. is there a package which can be helpful ? if yes then how I can use it. Rgds, Vineet [[alternative HTML version deleted]]
You could phrase this in most dialects of SQL, but you don't say what kind of database you are using and this is not a SQL help list. You could also look at the rollapply function in the zoo package. --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN:<jdnewmil@dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity. Vineet Shukla <shuklvineet@gmail.com> wrote: Hi, Premises: I have a database which contain the list of events and their time stamps (This is a Unix time stamps) What I want to do : I want know how much is the maximum occurrence of this in any a time period of 7 days or does a event occur es more than "N" (say 5) times in a period of 7 days. This time period is not fixed with "week boundary", its a period of 7 days occurring at any time. Question : How it can be done in R. is there a package which can be helpful ? if yes then how I can use it. Rgds, Vineet [[alternative HTML version deleted]] _____________________________________________ 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. [[alternative HTML version deleted]]
R. Michael Weylandt <michael.weylandt@gmail.com>
2011-Sep-07 21:52 UTC
[R] finding events in a time duration.
I think (no promises) roll.apply() from the zoo package with sum can count occurrences in whatever time period. Then use a logical test to identify sufficiently active periods. Hope this helps, Michael Weylandt On Sep 7, 2011, at 4:07 PM, Vineet Shukla <shuklvineet at gmail.com> wrote:> Hi, > > Premises: I have a database which contain the list of events and their time > stamps (This is a Unix time stamps) > > What I want to do : I want know how much is the maximum occurrence of this > in any a time period of 7 days or does a event occur es more than "N" (say > 5) times in a period of 7 days. > This time period is not fixed with "week > boundary", its a period of 7 days occurring at any time. > > > Question : How it can be done in R. is there a package which can be helpful > ? if yes then how I can use it. > > > Rgds, > Vineet > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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.
Reasonably Related Threads
- How to find frequent sequences.
- 1. Re: Re: [Xen-devel] Re: switchroot mount failed
- Loop-vectorizer prototype for the EPI Project based on the RISC-V Vector Extension (Scalable vectors)
- how to do tracing in user process.
- Loop-vectorizer prototype for the EPI Project based on the RISC-V Vector Extension (Scalable vectors)