Convert string descriptions of competitors into their number
Character vector to be converted
Names vector (usually
The internal mechanism of functions such as
ggol(), and all the
C++ code, operates with the competitors labelled with a
non-negative integer; it is then natural to refer to the competitors as
However, sometimes the competitors have names (as in, for example, the
rowing dataset). If so, it is more natural to refer to the
competitors using their names rather than an arbitrary integer.
character_to_number() converts the names to numbers. If
an element of
char is not present in
pnames, an error is
char2num() is an easy-to-type synonym.
Robin K. S. Hankin
1 2 3 4 5 6 7 8
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.