generate_topline_args: Generate a list of topline arguments

View source: R/generate_arguments.R

generate_topline_argsR Documentation

Generate a list of topline arguments

Description

This function is helper for generate_tbls(). It automatically generates a list of arguments to be passed on to generate_tbls() for a given set of arguments. This may be useful when the number of variables in a data frame is large, and there is a need to generate varying arguments efficiently.

Usage

generate_topline_args(df, var_of_interest = NULL, rm = NULL)

Arguments

df

A data frame or tibble.

var_of_interest

A single string of the variable of interest. Defaults to NULL, which returns all variables in df unless rm is NULL.

rm

A character vector of variables to be removed from consideration. Defaults to NULL.

Value

A list of arguments. If n tables were to be generated, this is a tibble with dimensions (n, 2).

See Also

generate_tbls() for an example of a list of arguments.

Examples


# Generate list of arguments
generate_topline_args(df, "var_of_interest")

# Specified removal variables
rm <- c("col19", "col20")
generate_topline_args(df, "var_of_interest", rm)


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