bd: sequence for insertions

Description Usage Arguments Value Examples

View source: R/f0.rbsb1.code.r

Description

This function returns n1:n2 when n1<=n2 and numeric(0) otherwise.
Quite useful when some insertion must be done within a sequence

Usage

1
bd(n1, n2)

Arguments

n1

first element

n2

second element

Value

n1:n2 if n1<n2 else numeric(0).

Examples

1
2
 xx <- 1:5;
 for (ii in 1:6) { print(c(xx[bd(1, ii-1)], 10, xx[bd(ii, 5)]));}

rbsb documentation built on May 31, 2017, 1:45 a.m.