Learn R Programming

ArchaeoPhases (version 2.1.0)

as_phases: Coerce to Phases

Description

Coerce to Phases

Usage

as_phases(from, ...)

# S4 method for matrix as_phases( from, calendar = get_calendar(), start = seq(from = 1, to = ncol(from), by = 2), stop = start + 1, names = NULL, iteration = NULL )

# S4 method for data.frame as_phases( from, calendar = get_calendar(), start = seq(from = 1, to = ncol(from), by = 2), stop = start + 1, names = NULL, iteration = NULL )

Value

A PhasesMCMC object.

Arguments

from

from An object to be coerced.

...

Currently not used.

calendar

A aion::TimeScale object specifying the source calendar (see aion::calendar()).

start

An integer vector specifying the index of the columns corresponding to the beginning of the phases. If missing, every other column is used starting from the first column (after deleting the iteration column, if any).

stop

An integer vector specifying the index of the columns corresponding to the end of the phases. If missing, every other column is used starting from the second column (after deleting the iteration column, if any).

names

A character vector giving the names of the phases.

iteration

A length-one numeric vector specifying the index of the iteration column.

Author

A. Philippe, M.-A. Vibet, N. Frerebeau

See Also

Other read methods: as_coda(), as_events(), check, read_bcal(), read_chronomodel, read_oxcal()

Examples

Run this code
## Coerce to phases
(pha <- as_phases(mcmc_phases, calendar = CE(), start = c(1, 3), iteration = 1))
summary(pha, calendar = CE())

## Plot phases
plot(pha)
plot(pha, succession = "hiatus")
plot(pha, succession = "transition")

## Compute phases from events
(eve <- as_events(mcmc_events, calendar = CE(), iteration = 1))

## Compute min-max range for all chains
pha1 <- phases(eve)
summary(pha1, calendar = CE())

## Compute min-max range by group
pha2 <- phases(eve, groups = list(phase_1 = c(1, 3), phase_2 = c(2, 4)))
summary(pha2, calendar = CE())

Run the code above in your browser using DataLab