facet_colcount | R Documentation |
Get or set column count for a facet in column space
facet_colcount(obj, path)
## S4 method for signature 'LayoutColTree'
facet_colcount(obj, path = NULL)
## S4 method for signature 'LayoutColLeaf'
facet_colcount(obj, path = NULL)
## S4 method for signature 'VTableTree'
facet_colcount(obj, path)
## S4 method for signature 'InstantiatedColumnInfo'
facet_colcount(obj, path)
facet_colcount(obj, path) <- value
## S4 replacement method for signature 'LayoutColTree'
facet_colcount(obj, path) <- value
## S4 replacement method for signature 'LayoutColLeaf'
facet_colcount(obj, path) <- value
## S4 replacement method for signature 'VTableTree'
facet_colcount(obj, path) <- value
## S4 replacement method for signature 'InstantiatedColumnInfo'
facet_colcount(obj, path) <- value
obj |
( |
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 |
( |
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.
Updating a lower-level (more specific) column count manually will not update the counts for its parent facets. This cannot be made automatic because the rtables framework does not require sibling facets to be mutually exclusive (e.g., total "arm", faceting into cumulative quantiles, etc) and thus the count of a parent facet will not always be simply the sum of the counts for all of its children.
col_counts()
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.