get_intervals: Calculate the intervals between events

Description Usage Arguments Details Value Author(s) Examples

View source: R/EIdist.R

Description

Calculate the intervals between a series of times, spreading out equal times in one unit of time.

Usage

1
 get_intervals(event_times)

Arguments

event_times

A numeric vector of times of occurrence of events.

Details

get_intervals calculates the intervals between the times passed in event_times, adding increments to spread out times that are exactly the same. This can be a problem when the times are integers, as in days. The spreading out of events avoids zero intervals. The rationale for this is that even if more than event occurred on the same day, it is extremely unlikely that the events occurred at exactly the same time of day. The best estimate of the times of day is a uniform distribution over one day.

Value

a vector of intervals between the vector of times passed

Author(s)

Jim Lemon

Examples

1
2
 event_times<-c(1,3,5,5,7,9,10,10,10,12)
 get_intervals(event_times)

Example output

[1] 2.0000000 2.0000000 0.5000000 1.5000000 2.0000000 1.0000000 0.3333333
[8] 0.3333333 1.3333333

eventInterval documentation built on May 1, 2019, 9:22 p.m.