createIncrement: Create a Variable with Incremental Unit Intervals

Description Usage Arguments Value Examples

View source: R/utility_functions.R

Description

A function to take a discrete variable and generate a new variable with the same number of levels whose values increase in unit increments. This is useful, for instance, if you have a variable encoding irregular subject ID numbers that you would like to use for indexing purposes.

Usage

1

Arguments

x

a vector of values.

Value

Returns a vector of matching length to x with incremental unit intervals corresponding to each level of the original variable.

Examples

1
2
x = c( 2320, 1038, 3010, 7503 )
print( createIncrement(x) )

rettopnivek/utilityf documentation built on March 1, 2021, 7:05 p.m.