uniteStrata: Unite one or more columns in strata_name-strata_level format

View source: R/unite.R

uniteStrataR Documentation

Unite one or more columns in strata_name-strata_level format

Description

Unites targeted table columns into strata_name-strata_level columns.

Usage

uniteStrata(x, cols = character(0), keep = FALSE, ignore = c(NA, "overall"))

Arguments

x

Tibble or dataframe.

cols

Columns to aggregate.

keep

Whether to keep the original columns.

ignore

Level values to ignore.

Value

A tibble with the new columns.

Examples

x <- dplyr::tibble(
  variable = "number subjects",
  value = c(10, 15, 40, 78),
  sex = c("Male", "Female", "Male", "Female"),
  age_group = c("<40", ">40", ">40", "<40")
)

x |>
  uniteStrata(c("sex", "age_group"))


visOmopResults documentation built on Sept. 24, 2024, 1:08 a.m.