Description Usage Arguments Details Value Author(s) See Also
Map character to integer.
1 | char2int(v)
|
v |
A character vector. |
Maps a character vector to an integer vector. Strings are mapped to integers in the
order that they are encountered, as enumerated from the beginning of the input vector. All
occurances of a given string are mapped to the same integer. Integer enumeration spans
1:n
, where n == length(unique(v))
.
R> v1 [1] "f" "f" "f" "a" "a" "a" "a" "f" "f" "d" "d" "d" "d" "d" "a" "a" R> char2int(v1) f f f a a a a f f d d d d d a a 1 1 1 2 2 2 2 1 1 3 3 3 3 3 2 2
A vector of class integer.
David Braze davebraze@gmail.com
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.