get_intervals: Information on intervals in which times fall

Description Usage Arguments Value See Also Examples

View source: R/interval-information.R

Description

Information on intervals in which times fall

Usage

1
2
3
4
5
get_intervals(x, times, ...)

## Default S3 method:
get_intervals(x, times, left.open = TRUE,
  rightmost.closed = TRUE, ...)

Arguments

x

An object from which interval information can be obtained, see int_info.

times

A vector of times for which corresponding interval information should be returned.

...

Further arguments passed to findInterval.

left.open

logical; if true all the intervals are open at left and closed at right; in the formulas below, should be swapped with < (and > with ), and rightmost.closed means ‘leftmost is closed’. This may be useful, e.g., in survival analysis computations.

rightmost.closed

logical; if true, the rightmost interval, vec[N-1] .. vec[N] is treated as closed, see below.

Value

A data.frame containing information on intervals in which values of times fall.

See Also

findInterval int_info

Examples

1
2
3
4
5
6
set.seed(111018)
brks <- c(0, 4.5, 5, 10, 30)
int_info(brks)
x <- runif (3, 0, 30)
x
get_intervals(brks, x)

adibender/ped documentation built on Dec. 16, 2019, 12:33 a.m.