Learn R Programming

rtables (version 0.6.12)

facet_colcount: Get or set column count for a facet in column space

Description

Get or set column count for a facet in column space

Usage

facet_colcount(obj, path)

# S4 method for LayoutColTree facet_colcount(obj, path = NULL)

# S4 method for LayoutColLeaf facet_colcount(obj, path = NULL)

# S4 method for VTableTree facet_colcount(obj, path)

# S4 method for InstantiatedColumnInfo facet_colcount(obj, path)

facet_colcount(obj, path) <- value

# S4 method for LayoutColTree facet_colcount(obj, path) <- value

# S4 method for LayoutColLeaf facet_colcount(obj, path) <- value

# S4 method for VTableTree facet_colcount(obj, path) <- value

# S4 method for InstantiatedColumnInfo facet_colcount(obj, path) <- value

Value

for facet_colcount the current count associated with that facet in column space, for facet_colcount<-, obj modified with the new column count for the specified facet.

Arguments

obj

(ANY)
the object for the accessor to access or modify.

path

character. This path must end on a split value, e.g., the level of a categorical variable that was split on in column space, but it need not be the path to an individual column.

value

(ANY)
the new value.

See Also

col_counts()

Examples

Run this code
lyt <- basic_table() %>%
  split_cols_by("ARM", show_colcounts = TRUE) %>%
  split_cols_by("SEX",
    split_fun = keep_split_levels(c("F", "M")),
    show_colcounts = TRUE
  ) %>%
  split_cols_by("STRATA1", show_colcounts = TRUE) %>%
  analyze("AGE")

tbl <- build_table(lyt, ex_adsl)

facet_colcount(tbl, c("ARM", "A: Drug X"))
facet_colcount(tbl, c("ARM", "A: Drug X", "SEX", "F"))
facet_colcount(tbl, c("ARM", "A: Drug X", "SEX", "F", "STRATA1", "A"))

## modify specific count after table creation
facet_colcount(tbl, c("ARM", "A: Drug X", "SEX", "F", "STRATA1", "A")) <- 25

## show black space for certain counts by assign NA

facet_colcount(tbl, c("ARM", "A: Drug X", "SEX", "F", "STRATA1", "C")) <- NA

Run the code above in your browser using DataLab