create_composite: Create Composites

View source: R/create_composite.R

create_compositeR Documentation

Create Composites

Description

This function will take as input a dataset, a selection of columns, and a name for the column to be created

Usage

create_composite(data, selection, name, na.rm = T)

Arguments

data

The data to add a composite column to

selection

A tidy selection of the variables that are to be averaged together

name

The name of the variable to be created

na.rm

Set to TRUE (default), will adjust the denominator in the case of missing data. If set to false, will return NA if the row has any missing data

Value

a tibble object

Examples

mtcars |> create_composite(c(drat, gear), drat_gear_average)

lirabenjamin/Ben documentation built on Aug. 6, 2024, 7:11 p.m.