Skip to contents

An arrange method for gen_tibble objects

Usage

# S3 method for class 'gen_tbl'
arrange(..., deparse.level = 1)

Arguments

...

a gen_tibble and a data.frame or tibble

deparse.level

an integer controlling the construction of column names.

Value

a gen_tibble

Examples

test_gt <- example_gt("gen_tbl")
test_gt %>% arrange(id)
#> # A gen_tibble: 6 loci
#> # A tibble:     7 × 3
#>   id    population  genotypes
#>   <chr> <chr>      <vctr_SNP>
#> 1 a     pop1                1
#> 2 b     pop1                2
#> 3 c     pop2                3
#> 4 d     pop2                4
#> 5 e     pop1                5
#> 6 f     pop3                6
#> 7 g     pop3                7
test_gt <- example_gt("grouped_gen_tbl_sf")
test_gt %>% arrange(id)
#> Simple feature collection with 7 features and 5 fields
#> Geometry type: POINT
#> Dimension:     XY
#> Bounding box:  xmin: 0 ymin: 41 xmax: 2 ymax: 51
#> Geodetic CRS:  WGS 84
#> # A gen_tibble: 6 loci
#> # A tibble:     7 × 6
#> # Groups:       population [3]
#>   id    population longitude latitude  genotypes    geometry
#>   <chr> <chr>          <dbl>    <dbl> <vctr_SNP> <POINT [°]>
#> 1 a     pop1               0       51          1      (0 51)
#> 2 b     pop1               0       51          2      (0 51)
#> 3 c     pop2               2       49          3      (2 49)
#> 4 d     pop2               2       49          4      (2 49)
#> 5 e     pop1               0       51          5      (0 51)
#> 6 f     pop3               2       41          6      (2 41)
#> 7 g     pop3               2       41          7      (2 41)