Consider the following:
"16D" < "7A"
returns TRUE.
Why is that and how can I compare such character strings such that the number is compared first then the letter? This way the answer would be false because 16>7 and D>A?
Can you adapt this?
library("gtools")
(m <- mixedorder(c("16D","7A")))
## [1] 2 1
m[1] < m[2] ## FALSE
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With