tabyl.tbl_svy: Survey weighted method for 'tabyl'

Description Usage Arguments Value

View source: R/weighted_analysis.R

Description

‘janitor::tabyl()', while great, doesn’t work with weighted data. This is a start to fixing that; it takes a 'tbl_svy' object and does 'tabyl' on it (roughly). Currently it only works for 1 or 2 variables, and really does not look like ‘tabyl'’s internals so be careful.

Usage

1
2
## S3 method for class 'tbl_svy'
tabyl(data, var1, var2, show_na = TRUE, ...)

Arguments

data

A weighted data object of class 'tbl_svy'

var1

The variable to be tabulated, or the grouping variable

var2

(Optional) the variable to be tabulated within each 'var1' group

show_na

Whether rows/columns that are 'NA' should be included

...

Currently unused

Value

A 'data.frame' containing weighted counts in each one-way or two-way combination of the input variables.


jayleetx/jay_utils documentation built on Jan. 24, 2021, 6:09 a.m.