Using Max Function On Character Vectors in R
<p>How do we understand <code>max</code> function on character vectors in R?</p>

<pre><code>&gt; max("MSP1","2C")
[1] "MSP1"
&gt; max("202","6B")
[1] "6B"
&gt; max("99","5C")
[1] "99"
</code></pre>

<p>When I read the documentation, it mentions that "Character versions are sorted lexicographically" and that "The type of the result will be that of the highest of the inputs in the hierarchy integer &lt; double &lt; character". </p>

<p>Does this mean that they compare the characters, position by position? In the first case, since "M" is greater than "2", then "MSP1" > "2C". Thus, only the first position from both characters are compared?</p>