Contextual user-facing helper function for dplyr verbs with SummarizedExperiment
objects. These functions are intended to be used as the top level call to
any dplyr verbs ...
argument, similar to that of across()
/if_any()
/if_all()
.
Specifies that the following expressions should be evaluated within the colData context.
Specifies that the following expressions should be evaluated within the rowData context.
Specify a single expression to evaluate in another context
Specify a single expression to evaluate in another context
Specify a single expression to evaluate in another context
Usage
cols(...)
rows(...)
col_ctx(x, asis = FALSE)
row_ctx(x, asis = FALSE)
assay_ctx(x, asis = FALSE)
Examples
# cols
mutate(se_simple,
cols(is_drug = condition=="drug"),
#bind a different context
effect = col_ctx(counts + (is_drug * rbinom(n(), 20, .3))))
#> class: SummarizedExperiment
#> dim: 5 4
#> metadata(0):
#> assays(3): counts logcounts effect
#> rownames(5): row_1 row_2 row_3 row_4 row_5
#> rowData names(3): gene length direction
#> colnames(4): col_1 col_2 col_3 col_4
#> colData names(3): sample condition is_drug