Skip to contents

String is used as combination name. However, the combination of A and B can be "A/B" or "B/A", this would make it difficult in comparison of combination names. By using this function, the name of strains included in a combination will be sorted alphabetically, so that the combination names can be identical and human-friendly.

Usage

sort_combination(x, sep = "/")

Arguments

x

a string or a character vector

sep

separator

Value

a string

Examples

  sort_combination("A1/A11/A2/B3/D5/C11")
#> [1] "A1/A2/A11/B3/C11/D5"
  sort_combination(c("A1/A11/A2/B3/D5/C11","A1/A11/A25/B3/D18/C11") )
#> [1] "A1/A2/A11/B3/C11/D5"   "A1/A11/A25/B3/C11/D18"