Usage
eventCounts(data, dateCol="Date", from = NULL, to = NULL,
by = "1 month", categoryCol=NULL, takeOnly=NULL, prefix="n_")Arguments
data
Data frame that should include any columns whose names appear in other
function arguments.
dateCol
Name of column that holds vector of dates
from
Starting date. If NULL set to first date given. If supplied,
any rows earlier than from will be omitted. Similarly, rows
later than any supplied date to will be omitted.
to
Final date, for which numbers of events are to be tallied. If
NULL set to final date given.
by
Time event to be used; e.g. "1 day", or "1 week", or "4 weeks",
or "1 month", or "1 quarter", or "1 year", or "10 years".
categoryCol
If not NULL create one column of counts for each level (or if
not a factor, unique value).
takeOnly
If not NULL, a charater string that when deparsed and executed
will return a vector of logicals.
prefix
If categoryCol is not NULL, a prefix for the names of the
columns of counts. Otherwise (categoryCol=NULL) a name for the
column of counts.