Skip to contents

Get adjacent indices

Usage

get_indices(x, max_x, k = 1)

Arguments

x

Origin index.

max_x

Max value.

k

Numeric value with the range of the indices.

Value

Vector with indices

Examples

get_indices(1, 10)
#> [1] 1 2
get_indices(1, 10, 5)
#> [1] 1 2 3 4 5 6