slice: Discretization of continuous time dimension - slicing

View source: R/slice.R

sliceR Documentation

Discretization of continuous time dimension - slicing

Description

The function will slices time with a given set of boundaries and produce a time scale object if desired.

Usage

slice(x, breaks, offset = 0, ts = TRUE, revtime = TRUE)

Arguments

x

(numeric) Vector of continouos age/time estimates.

breaks

(numeric) Vector of boundaries, the breaks argument of the cut function

offset

(numeric) Single value. If desired the resulting integer bin numbers can be offset by some amount.

ts

(logical) Should a time scale object be also produced when the function is run?

revtime

(logical) Should the time dimension be reversed? This argument is set to TRUE by default, meaning that the function will reverse the order of time: smaller values of x will be translated to higher values (slc) in the function output.

Details

Due to stratigraphic constraints, we can only process deep time data, when it is sliced to discrete bins. It is suggested that you do this separately for most of your analyses. This function is also used by the codedivDyn function when age entries are provided.

Value

Either of new entries and levels or time scale.

Examples

y<- runif(200, 0,100)
au <- slice(y, breaks=seq(0, 100, 10))
withOut <- slice(y, breaks=seq(0, 100, 10), ts=FALSE)

divDyn documentation built on Sept. 5, 2022, 5:07 p.m.