compute_cat: Count or Proportion

Description Usage Arguments Value

View source: R/compute_quant.R

Description

compute_cat takes an indicator variable and returns either the proportion or count of TRUE values.

Usage

1
compute_cat(x, prop = F, na.rm = T, digits = 3)

Arguments

x

a vector containing entries for the indicator variable (either TRUE/FALSE or 1/0).

prop

a logical. If TRUE, then a proportion is returned. If FALSE, then a count is returned.

na.rm

a logical. If TRUE, then NA values are removed.

digits

an integer specifying the number of significant digits to report.

Value

a scalar containing the count or proportion.


Scott-Coggeshall/magictable documentation built on July 30, 2020, 2:19 a.m.