Skip to contents

A small helper that turns long count data, such as expression_sim, into the wide layout that recipes and models expect: one row per sample and one column per gene.

Usage

bio_counts_wide(
  .data,
  feature = "gene",
  sample = "sample",
  value = "count",
  keep = "condition"
)

Arguments

.data

A data frame in long format.

feature, sample, value

<tidy-select> Feature, sample and value columns.

keep

<tidy-select> Sample-level columns to carry across, such as the condition.

Value

A tibble with one row per sample.

Examples

wide <- bio_counts_wide(expression_sim)
dim(wide)
#> [1]    8 1002