Constructs the minimum and maximum for a group of events (phase).
Usage
phase(x, groups, ...)
# S4 method for EventsMCMC,missing
phase(x)
# S4 method for EventsMCMC,list
phase(x, groups)
Arguments
- x
An
EventsMCMC
.- groups
A
list
.- ...
Currently not used.
Value
A PhasesMCMC
object.
Note
The default value of start
or end
corresponds to a CSV file exported
from ChronoModel.
See also
Other phase tools:
boundaries()
,
duration()
,
transition()
Examples
## Coerce to MCMC objects
## Events
(eve <- as_events(events[1:10000, ], calendar = "CE", iteration = 1))
#> <EventsMCMC>
#> - Number of events: 4
#> - Time scale: CE
## Phases
(pha <- as_phases(phases[1:10000, ], start = c(1, 3), calendar = "CE",
iteration = 1))
#> <PhasesMCMC>
#> - Number of phases: 2
#> - Time scale: CE
## Compute phases from events/dates
## Compute min-max range for all chains
pha1 <- phase(eve)
## Compute min-max range by group
## Unless otherwise specified, the phases are assumed to be unordered
pha2 <- phase(eve, groups = list(phase_1 = c(1, 3), phase_2 = c(2, 4)))
all(pha == pha2) # TRUE
#> [1] TRUE