after: Is index after reference ?

Description Usage Arguments Examples

View source: R/0-Functions.R

Description

Test if the x index falls before or after the reference index. If it is after, return 1, if before, return 0.

Usage

1
after(x, ref)

Arguments

x

Current index

ref

Reference index used to test if x is before or after

Examples

1
2
3
4
5
6
7
# Is 5 before 2 ?
after(2,5)
# Set result to 0 if the i index is before 5:
a= rep(0,10)
for(i in 1:10){
  a[i]= sqrt(i)*after(i,5)
}

VEZY/DynACof documentation built on Feb. 3, 2021, 8:52 p.m.