Sort a Ranges object

# S3 method for Ranges
arrange(.data, ...)

Arguments

.data

A Ranges object.

...

Comma seperated list of variable names.

Value

A sorted Ranges object

Examples

rng <- as_iranges(data.frame(start = 1:10, width = 10:1))
rng <- mutate(rng, score = runif(10))
arrange(rng, score)
#> IRanges object with 10 ranges and 1 metadata column:
#>            start       end     width |     score
#>        <integer> <integer> <integer> | <numeric>
#>    [1]         3        10         8 |  0.211409
#>    [2]         1        10        10 |  0.229906
#>    [3]         9        10         2 |  0.357774
#>    [4]         8        10         3 |  0.445148
#>    [5]        10        10         1 |  0.455731
#>    [6]         4        10         7 |  0.463701
#>    [7]         2        10         9 |  0.597575
#>    [8]         5        10         6 |  0.647101
#>    [9]         7        10         4 |  0.676398
#>   [10]         6        10         5 |  0.960573
# you can also use dplyr::desc to arrange by descending order