wtd_table {blocs}R Documentation

Weighted frequency table or proportions

Description

Weighted frequency table or proportions

Usage

wtd_table(
  ...,
  weight = NULL,
  na.rm = FALSE,
  prop = FALSE,
  return_tibble = FALSE,
  normwt = FALSE
)

Arguments

...

vectors of class factor or character, or a list/data.frame of such vectors.

weight

optional vector of weights. The default uses uniform weights of 1.

na.rm

logical, whether to remove NA values.

prop

logical, whether to return proportions or counts. Default returns counts.

return_tibble

logical, whether to return a tibble or named vector.

normwt

logical, whether to normalize weights such that they sum to 1.

Value

a vector or tibble of counts or proportions by group


[Package blocs version 0.1.1 Index]