sort bstr

# S3 method for bstr
sort(x, decreasing = FALSE, ..., by = c("names", "length"))

Arguments

x

x

decreasing

logical. FALSE

...

...

by

c("names", "length")

Examples

test <- bstr_rand_seq(6, c(10, 5, 10, 12, 13, 3), seed = 1) test
#> class: bstr,character #> number of sequences: 6 #> [1] no name 1 : NTdvKuxigD 10 #> [2] no name 2 : KJjTo 5 #> [3] no name 3 : ZlzTowLhGN 10 #> [4] no name 4 : UATtRZfZJrip 12 #> [5] no name 5 : FlVqhocbpBYmk 13 #> [6] no name 6 : YsW 3
sort(test, decreasing = TRUE)
#> class: bstr,character #> number of sequences: 6 #> [1] no name 6 : YsW 3 #> [2] no name 5 : FlVqhocbpBYmk 13 #> [3] no name 4 : UATtRZfZJrip 12 #> [4] no name 3 : ZlzTowLhGN 10 #> [5] no name 2 : KJjTo 5 #> [6] no name 1 : NTdvKuxigD 10
sort(test, by = "length")
#> class: bstr,character #> number of sequences: 6 #> [1] no name 6 : YsW 3 #> [2] no name 2 : KJjTo 5 #> [3] no name 1 : NTdvKuxigD 10 #> [4] no name 3 : ZlzTowLhGN 10 #> [5] no name 4 : UATtRZfZJrip 12 #> [6] no name 5 : FlVqhocbpBYmk 13