Learn R Programming

pollster (version 0.1.6)

summary_table: weighted summary table

Description

summary_table returns a tibble containing a weighted summary table of a single variable.

Usage

summary_table(df, variable, weight, name_style = "clean")

Value

a tibble

Arguments

df

The data source

variable

the variable to summarize, it should be numeric

weight

The weighting variable

name_style

the style of the column names--one of "clean" or "pretty." Clean names are all lower case and words are separated by an underscore. Pretty names begin with a capital letter are words a separated by a space.

Details

The resulting tible includes columns for the variable name, unweighted observations, weighted observations, weighted mean, minimum value, maximum value, unweighted missing values, and weighted missing values

Examples

Run this code
summary_table(illinois, age, weight)
summary_table(illinois, age, weight, name_style = "pretty")

Run the code above in your browser using DataLab