Phase Duration
Usage
duration(x, y, ...)
# S4 method for numeric,numeric
duration(x, y)
# S4 method for PhasesMCMC,missing
duration(x)
Arguments
- x, y
A
numeric
vector. Ify
is missing,x
must be anPhasesMCMC
object.- ...
Currently not used.
See also
Other phase tools:
boundaries()
,
phase()
,
transition()
Examples
## Coerce to MCMC
eve <- as_events(events, calendar = "CE", iteration = 1)
eve <- eve[1:10000, ]
## Compute min-max range by group
## Unless otherwise specified, the phases are assumed to be unordered
pha <- phase(eve, groups = list(A = c(1, 3), B = c(2, 4)))
## Compute phase ranges
boundaries(pha)
#> lower upper
#> A -1046.091 -202.1504
#> B -1972.281 -1078.0925
## Compute phase transition
tra <- transition(pha)
as.data.frame(tra)
#> lower upper duration
#> B-A -1409.47 -501.6004 907.8698
## Compute phase hiatus
hia <- hiatus(pha)
as.data.frame(hia)
#> lower upper duration
#> B-A -1062.599 -1046.091 16.50864
## Compute phase duration
dur <- duration(pha)
summary(dur)
#> mad mean sd min q1 median q3 max lower upper
#> A 270 251 135 0 151 247 342 835 1 482
#> B 547 552 130 4 466 553 640 1156 291 800