generate_topline: Generate toplines

View source: R/generate_topline.R

generate_toplineR Documentation

Generate toplines

Description

This function takes a data frame or a tibble object, a variable of interest, and a string caption, returning a list object that is an instance of class flextable. The function implements data masking internally so users must specify data variables as strings (i.e. use "x", "weight").

Usage

generate_topline(df, x, weight, caption)

Arguments

df

A data frame or tibble.

x

A single string of variable name.

weight

A single string of the weighting variable.

caption

A length one character vector used as the caption for the topline.

Value

A list object, which is an object of class flextable.

Examples


# Generate a topline
df %>% generate_topline(df = ., "x_var", "weight", "X")


YangWu1227/citizenr documentation built on June 18, 2022, 12:17 p.m.