Learn R Programming

cxreg (version 1.0.0)

fixm: Fixes indices that fall outside the valid range 1:n using circular (modulo) wrapping.

Description

Fixes indices that fall outside the valid range 1:n using circular (modulo) wrapping.

Usage

fixm(v, n)

Value

An integer vector of the same length as v, with all values wrapped into the range 1 to n.

Arguments

v

An integer vector of indices.

n

A positive integer giving the length of the domain; valid indices are 1 to nobs.