# NOT RUN {
# rankings of H and C in H-H-H-H-C-C-C
rankdiff(1:4, 5:7, as.fraction=FALSE) # 12
rankdiff(1:4, 5:7) # 1
# rankings of H and C in C-C-C-H-H-H-H
rankdiff(4:7, 1:3, as.fraction=FALSE) # -12
rankdiff(4:7, 1:3) # -1
# rankings of H and C in H-C-H-C-H-C-H
rankdiff(c(1, 3, 5, 7), c(2, 4, 6)) # 0
# }
Run the code above in your browser using DataLab