index: index

Description Usage Arguments Examples

View source: R/utils.R

Description

Returns the index numbers for all values in an ascending vector between the floor of the x_ argument and the ceiling of the x + m_t_ arguments. This is a utility function often used for extracting the q_x values that are applicable to a subset of a LifeTable object.

Usage

1
index(x, x_, m_t_ = 1)

Arguments

x

vector of ascending numerics

x_

the index of the first x value to be returned.

m_t_

the index of the last x value to be returned. This is oftern m_ + t_, m_ or t_ when the x_ argument is set to x_ + t_.

Examples

1
2
3
4
my_x <- 0:9
index(my_x, x_ = 2, m_t_ = 3)
index(my_x, x_ = 2.4, m_t_ = 3)
index(my_x, x_ = 2.4, m_t_ = 0)

merlinoa/diehard3000 documentation built on May 22, 2017, 4:15 a.m.