svy_group_means: Show group counts and group means in srvyr data

svy_group_meansR Documentation

Show group counts and group means in srvyr data

Description

This function groups srvyr data by a grouping variable and then calculates and displays group means and counts with standard errors.

Usage

svy_group_means(df, gr, mean_vars, tbl_title, quietly = TRUE)

Arguments

df

A srvyr survey object

gr

Character. The name of the grouping variable in df.

mean_vars

Character vector. Names of one or more variables in df to calculate means for.

tbl_title

Character. Title for summary table to be printed.

quietly

Logical. Calculate means without displaying them. If they are to be displayed, the gt package needs to be installed.

Value

Dataframe with group counts and means


LukasWallrich/rNuggets documentation built on Aug. 26, 2022, 11:03 a.m.