alpha2int: `Single Character' <--> Integer Conversion for Discrete Data
Description
Simple conversion functions for discrete data (e.g., time series),
between 0:k integers and single letter characters.
Usage
alpha2int(x, alpha)
int2alpha(i, alpha)
Arguments
x
character vector of single letters.
alpha
the alphabet, as one character string.
i
integer vector of numbers in 0:k.
Value
alpha2int(x,*) returns an integer vector of the same
length as x, consisting of values from 0:k where
k + 1 is the length of the alphabet, nchar(alpha).
int2alpha(i,*) returns a vector of single lettercharacter of the same length as i.
See Also
vlmc, and
int2char() and its inverse, char2int(),
both working with multi-character strings instead of vectors of single
characters; further, alphabet.