Skip to contents

create grouping variables about the rowData and colData of a SummarizedExperiment object. Unlike the data.frame method the resulting output class is left unchanged. Thus dplyr generics for SummarizedExperiment must check grouping information manually.

Usage

# S3 method for class 'SummarizedExperiment'
group_by(.data, ..., .add = FALSE)

# S3 method for class 'SummarizedExperiment'
ungroup(x, ...)

Arguments

.data

a SummarizedExperiment object

...

contextual expressions specifying which columns to ungroup. Omitting ... ungroups the entire object.

.add

When FALSE, the default, group_by() will override existing groups.

x

A SummarizedExperiment object

Value

SummarizedExperiment object

Functions

  • ungroup(SummarizedExperiment): Ungroup a SummarizedExperiment object

Examples


group_by(se_simple, rows(direction), cols(condition))
#> # A SummarizedExperiment-tibble Abstraction: 5 × 4
#> # Groups: rows(direction), cols(condition)
#>     .features .samples | counts logcounts | direction gene  length | condition
#>     <chr>     <chr>    |  <int>     <dbl> | <chr>     <chr>  <int> | <chr>    
#>   1 row_1     col_1    |     14      2.64 | -         g1         1 | cntrl    
#>   2 row_2     col_1    |     19      2.94 | +         g2        24 | cntrl    
#>   3 row_3     col_1    |     16      2.77 | +         g3        60 | cntrl    
#>   4 row_4     col_1    |     11      2.40 | -         g4        39 | cntrl    
#>   5 row_5     col_1    |     18      2.89 | +         g5        37 | cntrl    
#>                                                                      
#> n-4 row_1     col_4    |      9      2.20 | -         g1         1 | drug     
#> n-3 row_2     col_4    |      4      1.39 | +         g2        24 | drug     
#> n-2 row_3     col_4    |     20      3.00 | +         g3        60 | drug     
#> n-1 row_4     col_4    |      3      1.10 | -         g4        39 | drug     
#> n   row_5     col_4    |      5      1.61 | +         g5        37 | drug     
#> # ℹ n = 20
#> # ℹ 1 more variable: sample <chr>